home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / dostech.arc / CHAP3 < prev    next >
Text File  |  1989-02-04  |  115KB  |  2,540 lines

  1. CHAPTER 3     THE PC ROM BIOS
  2.  
  3.  Programming Technical Reference - IBM
  4.  Copyright 1988, Dave Williams
  5.  
  6. Interrupt  10h  Video I/O - services to handle video output
  7. (0:0040h)       The ROM video routines in the original PC BIOS are designed for
  8.                 use with the Color Graphics Adapter and incorporate code to test
  9.                 for the horizontal retrace before writing. The check is
  10.                 performed no matter what actual display adapter is installed.
  11.                 The ROM character table for the first 128 characters is located
  12.                 at 0FA6Eh in the PC. Int 01Fh can be used to point to a second
  13.                 table of 128 characters.
  14.                  CS, SS, DS, ES, BX, CX, DX are preserved during call. All
  15.                 others are destroyed.
  16.  
  17. Function 00h    Determine or Set Video State
  18. entry   AH      00h     set video mode
  19.         AL      display mode:                    CGA|PCjr|MDA|MCGA|EGA|VGA|8514
  20.                 00h     40x25 B/W text           CGA|PCjr|   |    |EGA|   |
  21.   16 color      01h     40x25 color text         CGA|PCjr|   |    |EGA|   |
  22.                 02h     80x25 B/W text           CGA|PCjr|   |    |EGA|   |
  23.   16 color      03h     80x25 color text         CGA|PCjr|   |    |EGA|VGA|
  24.   4 color       04h     320x200 color graphics   CGA|PCjr|   |    |EGA|   |
  25.   4 tone gray   05h     320x200 B/W graphics     CGA|PCjr|   |    |EGA|   |
  26.   2 color       06h     640x200 B/W graphics     CGA|PCjr|   |    |EGA|   |
  27.   monochrome    07h     80x25 monochrome text       |    |MDA|    |EGA|   |
  28.   16 color      08h     160x200 color graphics   CGA|PCjr|   |    |   |   |
  29.   16 color      09h     320x200 color graphics      |PCjr|   |    |   |VGA|
  30.   4 color       0Ah     640x200 color graphics      |PCjr|   |    |   |   |
  31.      N/A        0Bh     BIOS font load              |    |   |    |EGA|VGA|
  32.      N/A        0Ch     BIOS font load              |    |   |    |EGA|VGA|
  33.   16 color      0Dh     320x200 graphics            |    |   |    |EGA|VGA|
  34.   16 color      0Eh     640x200 graphics            |    |   |    |EGA|VGA|
  35.   monochrome    0Fh     640x350 graphics            |    |   |    |EGA|VGA|
  36.   16 & 64 color 10h     640x350 color hi-res        |    |   |    |EGA|VGA|
  37.   2 color       11h     640x480 graphics            |    |   |MCGA|   |VGA|
  38.   16 color      12h     640x480 graphics            |    |   |    |   |VGA|
  39.   256 color     13h     320x200 graphics            |    |   |MCGA|   |VGA|8514
  40.                 14h-20h used by EGA and VGA graphics modes
  41.                 18h     132x44 8x8 char mono        | Tseng Labs EVA
  42.                 19h     132x25 8x14 char mono       | Tseng Labs EVA
  43.                 1Ah     132x28 8x13 char mono       | Tseng Labs EVA
  44.  monochrome     21h     Hercules Graphics, Graphics Page 1
  45.  monochrome     22h     Hercules Graphics, Graphics Page 2
  46.                 22h     132x44                      | Tseng, Ahead
  47.                 23h     132x25                      | Tseng Labs EVA
  48.                         132x25                      | Ahead Systems EGA2001
  49.                         132x25                      | ATI EGA Wonder
  50.                 24h     132x28                      | Tseng Labs EVA
  51.                 25h     80x60  640x480              | Tseng Labs EVA
  52.  16 color               640x480                     | VEGA VGA
  53.                 26h     80x60                       | Tseng Labs EVA
  54.                         80x60   640x480             | Ahead Systems EGA2001
  55.  16 color       27h     720x512                     | VEGA VGA
  56.  monochrome             132x25                      | ATI EGA Wonder
  57.                 28h     unknown                     | VEGA VGA
  58.  16 color       29h     800x600                     | VEGA VGA
  59.  256 color      2Dh     640x350                     | VEGA VGA
  60.  256 color      2Eh     640x480                     | VEGA VGA
  61.  256 color      2Fh     720x512                     | VEGA VGA
  62.  256 color      30h     800x600                     | VEGA VGA
  63.                         unknown                     | AT&T 6300
  64.  16 color       36h     960x720                     | VEGA VGA
  65.  16 color       37h     1024x768                    | VEGA VGA
  66.  monochrome             132x44                      | ATI EGA Wonder
  67.  2 color        40h     640x400                     | AT&T 6300
  68.                         80x43                       | VEGA VGA
  69.  16 color       41h     640x200                     | AT&T 6300
  70.                         132x25                      | VEGA VGA
  71.  16 color       42h     640x400                     | AT&T 6300
  72.                         132x43                      | VEGA VGA
  73.                 43h     unsupported 640x200 of 640x400 viewport  AT&T 6300
  74.                         80x60                       | VEGA VGA
  75.                 44h     disable VDC and DEB output  | AT&T 6300
  76.                         100x60                      | VEGA VGA
  77.                 48h     80x50   640x400             | AT&T 6300
  78.                 4Dh     120x25                      | VEGA VGA
  79.                 4Eh     120x43                      | VEGA VGA
  80.                 4Fh     132x25                      | VEGA VGA
  81.  monochrome     50h     132x25                      | Ahead Systems EGA2001
  82.  16 color               640x480                     | Paradise EGA-480
  83.  monochrome             80x43                       | VEGA VGA
  84.                         640x480 mono?               | Taxan 565 EGA
  85.                 51h     80x30                       | Paradise EGA-480
  86.  monochrome             132x25                      | VEGA VGA
  87.                         640x480 ?                   | ATI EGA Wonder
  88.  monochrome     52h     132x44                      | Ahead Systems EGA2001
  89.  monochrome             132x43                      | VEGA VGA
  90.                         752x410 ?                   | ATI EGA Wonder
  91.                 53h     800x560 ?                   | ATI EGA Wonder
  92.                 54h     132x43                      | Paradise EGA-480
  93.  16 color               132x43                      | Paradise VGA
  94.  16 color               132x43                      | Paradise VGA on multisync
  95.                         132x43                      | Taxan 565 EGA
  96.                 55h     132x25                      | Paradise EGA-480
  97.  16 color               132x25                      | Paradise VGA
  98.  16 color               132x25                      | Paradise VGA on multisync
  99.                         132x25                      | Taxan 565 EGA
  100.                 56h     132x43                      | NSI Smart EGA+
  101.                         132x43                      | Paradise VGA
  102.                         132x43                      | Paradise VGA on multisync
  103.  monochrome             132x43                      | Taxan 565 EGA
  104.                 57h     132x25                      | NSI Smart EGA+
  105.                         132x25                      | Paradise VGA
  106.                         132x25                      | Paradise VGA on multisync
  107.  monochrome             132x25                      | Taxan 565 EGA
  108.                 58h     100x75   800x600 16/256k    | Paradise VGA
  109.                 59h     100x75   800x600            | Paradise VGA
  110.                 5Eh     640x400                     | Paradise VGA,VEGA VGA
  111.                 5Fh     640x480                     | Paradise VGA
  112.                 60h     80x???   ???x400            |  Corona/Cordata BIOS v4.10+
  113.                         752x410                     | VEGA VGA
  114.                 60h     400 line graphics+80 col text |(Corona/Cordata)
  115.                 61h     400 line graphics           | Corona/Cordata BIOS v4.10+
  116.                         720x540                     | VEGA VGA
  117.                 62h     800x600                     | VEGA VGA
  118.  16 color       71h     100x35 800x600              | NSI Smart EGA+
  119.                 74h     640x400 graphics            | Toshiba 3100
  120.                 82h     80x25 B&W                   | AT&T VDC overlay mode *
  121.                 83h     80x25                       | AT&T VDC overlay mode *
  122.                 86h     640x200 B&W                 | AT&T VDC overlay mode *
  123.                 C0h     640x400   2/prog pallet     | AT&T VDC overlay mode *
  124.                 C4h     disable output              | AT&T VDC overlay mode *
  125.                 D0h     640x400                     | DEC VAXmate AT&T mode
  126.                 unknown 640x225                     | Z-100
  127.                 unknown 640x400                     | Z-100
  128.  
  129. note 1) If the high bit in AL is set, the display buffer is not cleared when a
  130.         new mode is selected. This may be used to mix modes on the display;
  131.         for example, characters of two difference sizes might be displayed
  132.      2) Modes 8-10 are available on the PCjr, Tandy 1000, and PS/2
  133.      3) IBM claims 100% software and hardware emulation of the CGA with the
  134.         MCGA chipset. All registers may be read and written as CGA. All
  135.         characters are double-scanned to give 80x25 with 400 line resolution.
  136.         The attributes for setting border color may be set on MCGA, but the
  137.         borders will remain the default color (they cannot actually be set)
  138.      4) The IBM Color Graphics Adapter (CGA) is too slow for the screen to
  139.         be updated before the vertical retrace of the monitor is completed.
  140.         If the video RAM is addressed directly, the screen will have "snow"
  141.         or interference. IBM's default is to turn the adapter off when it is
  142.         being updated, ie "flickering" when the display is scrolled.
  143.      5) The vertical retrace signal may be ignored when using the MCGA adapter.
  144.         The MCGA will not generate snow when written to. There is no flicker
  145.         with the MCGA.
  146.      6) The PCjr Video Gate Array uses a user-defined block of main system RAM
  147.         from 4 to 32k in size instead of having dedicated memory for the
  148.         display. Vertical retrace may be ignored when writing to the PCjr.
  149.         There is no flicker with the PCjr display.
  150.      7) The Hercules Graphics Card has 750x348 resolution
  151.      8) The Hercules Graphics Card takes 32k beginning at B:000 (same as MDA)
  152.      9) The CGA, MCGA, and VGA adapters use hardware address B:800
  153.     10) The BIOS clears the screen when the mode is set or reset.
  154.     11) For AT&T VDC overlay modes, BL contains the DEB mode, which may be 06h,
  155.         40h, or 44h
  156.  
  157.  
  158. Function 01h    Set Cursor Type - set the size of the cursor or turn it off
  159. entry   AH      01h
  160.         CH      bit values:
  161.                 bits 0-4  top line for cursor in character cell
  162.                 bits 5-6  blink attribute
  163.                           00    normal
  164.                           01    invisible (no cursor)
  165.                           10    slow      (not used on original IBM PC)
  166.                           11    fast
  167.         CL      bit values:
  168.                 bits 0-4  bottom line for cursor in character cell
  169. return  none
  170. note 1) The ROM BIOS default cursors are:  start    end
  171.                      monochrome mode 07h:    11     12
  172.                       text modes 00h-03h:     6      7
  173.      2) The blinking in text mode is caused by hardware and cannot be turned
  174.         off, though some kludges can temporarily fake a nonblinking cursor
  175.      3) The cursor is automatically turned off in graphics mode
  176.      4) Another method of turning off the cursor in text mode is to position it
  177.         to a nondisplayable address, such as (X,Y)=(0,25)
  178.      5) Buggy on EGA systems - BIOS remaps cursor shape in 43 line modes, but
  179.         returns unmapped cursor shape
  180.  
  181.  
  182. Function 02h    Set Cursor Position - reposition the cursor to (X,Y)
  183. entry   AH      02h
  184.         BH      video page
  185.                 00h     graphics mode
  186.                 03h     modes 2 and 3
  187.                 07h     modes 0 and 1
  188.         DH      row    (Y=0-24)
  189.         DL      column (X=0-79 or 0-39)
  190. return  none
  191. note 1) (0,0) is upper left corner of the screen
  192.  
  193.  
  194. Function 03h    Read Cursor Position - return the position of the cursor
  195. entry   AH      03h
  196.         BH      page number
  197.                 00h     in graphics modes
  198.                 03h     in modes 2 & 3
  199.                 07h     in modes 0 & 1
  200. return  CH      top line for cursor    (bits 4-0)
  201.         CL      bottom line for cursor (bits 4-0)
  202.         DH      row number    (Y=0-24)
  203.         DL      column number (X=0-79 or 0-39)
  204.  
  205.  
  206. Function 04h    Read Light Pen - fetch light pen information
  207. entry   AH      04h
  208. return  AH      00h     light pen not triggered
  209.         AH      01h     light pen is triggered, values in resgisters
  210.         BX      pixel column               (X=0-319 or 0-639)  graphics mode
  211.         CH      raster line                (Y=0-199)        old graphics modes
  212.         CX      (EGA) raster line (0-nnn)                   new graphics modes
  213.         DH      row of current position    (Y=0-24)            text mode
  214.         DL      column of current position (X=0-79 or 0-39)    text mode
  215. note    Not supported on PS/2
  216.  
  217.  
  218. Function 05h    Select Active Page - set page number for services 6 and 7
  219. entry   AH      05h
  220.         AL      number of new active page
  221.                 0-7     modes 00h and 01h (CGA)
  222.                 0-3     modes 02h and 03h (CGA)
  223.                 0-7     modes 02h and 03h (EGA)
  224.                 0-7     mode 0Dh (EGA)
  225.                 0-3     mode 0Eh (EGA)
  226.                 0-1     mode 0Fh (EGA)
  227.                 0-1     mode 10h (EGA)
  228. for PCjr only:
  229.         AL      80h to read CRT/CPU page registers
  230.                 81h to set CPU page register to value in BL
  231.                 82h to set CRT page register to value in BH
  232.                 83h to set both CPU and page registers
  233.                     (and Corona/Cordata BIOS v4.10+)
  234.         BH      CRT page number for subfunctions 82h and 83h
  235.         BL      CPU page register for subfunctions 81h and 83h
  236. return  standard PC  none
  237.         PCjr         if called with AH bit 7=1 then
  238.                      BH      CRT page register
  239.                      BL      CPU page register
  240.         DX      segment of graphics bitmap buffer (video modes 60h,61h; AL0Fh)
  241. note 1) Mono adapter has only one display page
  242.      2) CGA has four 80x25 text pages or eight 40x25 text pages
  243.      3) A separate cursor is maintained for each display page
  244.      4) Switching between pages does not affect their contents
  245.      5) Higher page numbers indicate higher memory positions
  246.  
  247.  
  248. Function 06h    Scroll Page Up - scroll up or clear a display "window"
  249. entry   AH      06h
  250.         AL      number of lines blanked at bottom of page
  251.                 0 = blank entire window
  252.         BH      attributes to be used on blank line
  253.         CH      row    (Y) of upper left corner or window
  254.         CL      column (X) of upper left corner of window
  255.         DH      row    (Y) of lower right corner of window
  256.         DL      column (X) of lower right corner of window
  257. return  none
  258. note 1) Push BP before scrolling, pop after
  259.      2) If in CGA text mode, affects current page only
  260.  
  261.  
  262. Function 07h    Scroll Page Down - scroll down or clear a display "window"
  263. entry   AH      07h
  264.         AL      number of lines to be blanked at top of page
  265.                 0 = blank entire window
  266.         BH      attributes to be used on blank line
  267.         CH      row    (Y) of upper left corner or window
  268.         CL      column (X) of upper left corner of window
  269.         DH      row    (Y) of lower right corner of window
  270.         DL      column (X) of lower right corner of window
  271. return  none
  272. note 1) Push BP before scrolling, pop after
  273.      2) If in CGA text mode, affects current page only
  274.  
  275.  
  276. Function 08h    Read Character Attribute - of character at current cursor pos.
  277. entry   AH      08h
  278.         BH      display page number - text mode
  279. return  AH      character attribute - text mode
  280.         AL      ASCII code of character at current cursor position
  281.  
  282.  
  283. Function  09h   Write Character and Attribute - at current cursor position
  284. entry   AH      09h
  285.         AL      ASCII code of character to display
  286.         BH      display page number - text mode
  287.         BL      attribute/color of character
  288.         CX      number of characters to write
  289. return  none
  290. note 1) CX should not exceed actual rows availible, or results may be erratic
  291.      2) Setting CX to zero will cause runaway
  292.      3) All values of AL result in some sort of display; the various control
  293.         characters are not recognized as special and do not change the current
  294.         cursor position
  295.      4) Does not change cursor position when called - the cursor must be
  296.         advanced with int 10 function 0Ah.
  297.      5) If used to write characters in graphics mode with bit 7 of AH set to 1
  298.         the character will by XORed with the current display contents.
  299.      6) In graphics mode the bit patterns for ASCII character codes 80h-0FFh
  300.         are obtained from a table. On the standard PC and AT, the location is at
  301.         interrupt vector 01Fh (0000:007C). For ASCII characters 00h-07Fh, the
  302.         table is at an address in ROM. On the PCjr the table is at interrupt
  303.         vector 44h (0000:00110) and is in addressable RAM (may be replaced by
  304.         the user)
  305.      7) All characters are displayed, including CR, LF, and BS
  306.  
  307.  
  308. Function 0Ah    Write Character - display character(s) (use current attribute)
  309. entry   AH      0Ah
  310.         AL      ASCII code of character to display
  311.         BH      display page - text mode
  312.         BL      color of character (graphics mode, PCjr only)
  313.         CX      number of times to write character
  314. return  none
  315. note 1) CX should not exceed actual rows availible, or results may be erratic
  316.      2) All values of AL result in some sort of display; the various control
  317.         characters are not recognized as special and do not change the current
  318.         cursor position
  319.      3) If used to write characters in graphics mode with bit 7 of AH set to 1
  320.         the character will by XORed with the current display contents.
  321.      4) In graphics mode the bit patterns for ASCII character codes 80h-0FFh
  322.         are obtained from a table. On the standard PC and AT, the location is at
  323.         interrupt vector 01Fh (0000:007C). For ASCII characters 00h-07Fh, the
  324.         table is at an address in ROM. On the PCjr the table is at interrupt
  325.         vector 44h (0000:00110) and is in addressable RAM (may be replaced by
  326.         the user)
  327.      5) In EGA in graphics modes, replication count in CX works correctly only
  328.         if all characters written are contained on the same row
  329.      6) All characters are displayed, including CR, LF, and BS
  330.  
  331.  
  332. Function 0Bh    Set Color Palette - set palette for graphics or text border
  333. entry   AH      0Bh
  334.         BH      00h     select border (text mode)
  335.         BL      color 0-15, 16-31 for high-intensity characters
  336.         BH      01h     set graphics palette with value in BL
  337.  (CGA)  BL      0       green/red/yellow
  338.                 1       cyan/magenta/white
  339.  (EGA) (graphics modes)
  340.         BH      0
  341.         BL      has border color (0-15) & high intensity bkgr'd color (16-31)
  342.         BH      1
  343.         BL      contains palette being selected (0-1)
  344. return  none
  345. note 1) Valid in CGA mode 04h, PCjr modes 06h, 08h-0Ah
  346.      2) Although the registers in the MCGA may be set as if to change the
  347.         border, the MCGA will not display a border no matter what register
  348.         settings are used.
  349.  
  350.  
  351. Function 0Ch    Write Dot - plot one graphics pixel
  352. entry   AH      0Ch
  353.         AL      dot color code  (0/1 in mode 6, 0-3 in modes 4 and 5)
  354.                 (set bit 7 to XOR the dot with current color)
  355.                 0-3 mode 04h, 05h
  356.                 0-1 mode 06h
  357.         BH      page number (ignored if adapter supports only one page)
  358.         CX      column (X=0000h - 027Fh)
  359.                 (0 - 319 in modes 4,5,13,  0 - 639 in modes 6,14,15,16)
  360.         DX      row    (Y=0000h - 00C7h) (0 - 199 CGA)
  361. return  none
  362. note    Video graphics modes 4-6 only
  363.  
  364.  
  365. Function 0Dh    Read Dot - determine the color of one graphics pixel
  366. entry   AH      0Dh
  367.         CX      column (X=0000h - 027Fh)  (0-319 or 639)
  368.         DX      row    (Y=0000h - 00C7h)  (0-199)
  369. return  AL      color of dot
  370. note    Only valid in graphics mode
  371.  
  372.  
  373. Function 0Eh    Write TTY - write one character and update cursor. Also handles
  374.                 CR (0Dh), beep (07h), backspace (10h), and scrolling
  375. entry   AH      0Eh
  376.         AL      ASCII code of character to be written
  377.         BH      page number (text)
  378.         BL      foreground color (video modes 6 & 7 only) (graphics)
  379. return  none
  380. note 1) The ASCII codes for bell, backspace, carriage return, and linefeed are
  381.         recognized and appropriate action taken. All other characters are
  382.         written to the screen and the cursor is advanced to the next position
  383.      2) Text can be written to any CGA page regardless of current active page
  384.      3) Automatic linewrap and scrolling are provided through this function
  385.      4) This is the function used by the DOS CON console driver.
  386.      5) This function does not explicitly allow the use of attributes to the
  387.         characters written. Attributes may be provided by first writing an ASCII
  388.         27h (blank) with the desired attributes using function 09h, then
  389.         overwriting with the actual character using this function. While clumsy
  390.         this allows use of the linewrap and scrolling services provided by
  391.         this function
  392.  
  393.  
  394. Function 0Fh    Return Current Video State - mode and size of the screen
  395. entry   AH      0Fh
  396. return  AH      number of character columns on screen
  397.         AL      mode currently set (see AH=00h for display mode codes)
  398.         BH      current active display page
  399. note    If mode was set with bit 7 set ("no blanking"), the returned mode will
  400.         also have bit 7 set
  401.  
  402.  
  403. Function 10h    Set Palette Registers
  404.                 PCjr, Tandy 1000, EGA, MCGA, VGA
  405. entry   AH      10h
  406.         AL      00h     set individual palette register
  407.                 01h     set border color palette register
  408.                 02h     set all palette registers and overscan
  409.                 03h     toggle blink/intensity bit           (EGA, MCGA, VGA)
  410.                 04h     unknown
  411.                 05h     unknown
  412.                 06h     unknown
  413.                 07h     read individual palette register                 (VGA)
  414.                 08h     read overscan (order color)                      (VGA)
  415.                 09h     read all palette registers and overscan register (VGA)
  416.                 10h     set individual video DAC color register    (MCGA, VGA)
  417.                 11h     unknown
  418.                 12h     set block of video DAC color registers     (MCGA, VGA)
  419.                 13h     set video DAC color page                         (VGA)
  420.                 14h     unknown
  421.                 15h     read individual video DAC color register   (MCGA, VGA)
  422.                 16h     unknown
  423.                 17h     read block of video DAC color registers    (MCGA, VGA)
  424.                 18h     unknown
  425.                 19h     unknown
  426.                 1Ah     read video DAC color-page state                  (VGA)
  427.                 1Bh     perform gray-scale summing                       (VGA)
  428.         BH      color value
  429.         BL      if AL=00h       palette register to set (00h-0Fh)
  430.                 if AL=03h       0       to enable intensity
  431.                                 1       to enable blinking
  432.         ES:DX   if AL=02h       pointer to 16-byte table of register values
  433.                                 followed by the overscan value:
  434.                                 bytes 0-15     values for palette registers 0-15
  435.                                 byte 16        value for border register
  436. return  none
  437. note    DAC is Digital to Analog Convertor circuit in MCGA/VGA chips
  438.  
  439.  
  440. Function 11h    Character Generator Routine (EGA and after)
  441. entry   AH      11h
  442.                 The following functions will cause a mode set, completely
  443.                 resetting the video environment, but without clearing the video
  444.                 buffer.
  445.                 AL      00h, 10h  load user-specified patterns
  446.                         ES:BP   pointer to user table
  447.                         CX      count of patterns to store
  448.                         DX      character offset into map 2 block
  449.                         BL      block to load in map 2
  450.                         BH      number of bytes per character pattern
  451.                 AL      01h, 11h  load ROM monochrome patterns (8 by 14)
  452.                         BL      block to load
  453.                 AL      02h, 12h  load ROM 8 by 8 double-dot patterns
  454.                         BL      block to load
  455.                 AL      03h       set block specifier
  456.                         BL      block specifier
  457.                 AL      04h       load 8x16 text characters (MCGA, VGA)
  458.                 AL      14h       set 8x16 text characters (MCGA, VGA)
  459.                 The routines called with AL=1x are designed to be called only
  460.                 immediately after a mode set and are similar to the routines
  461.                 called with AL=0x, except that:
  462.                         Page 0 must be active.
  463.                         Bytes/character is recalculated.
  464.                         Max character rows is recalculated.
  465.                         CRT buffer length is recalculated.
  466.                         CRTC registers are reprogrammed as follows:
  467.                         reg09h    bytes/char-1; max scan line (mode 7 only)
  468.                         reg0Ah    bytes/char-2; cursor start
  469.                         reg0Bh    0           ; cursor end
  470.                         reg12h    ((rows+1)*(bytes/char))-1
  471.                                               ; vertical display end
  472.                         reg14h    bytes/char  ; underline loc
  473.                                   (*** BUG: should be 1 less ***)
  474.                 The following functions are meant to be called only after a
  475.                 mode set:
  476.                 AL      20h     user 8 by 8 graphics characters (INT 1FH)
  477.                                 ES:BP = pointer to user table
  478.                 AL      21h     user graphics characters
  479.                         ES:BP   pointer to user table
  480.                         CX      bytes per character
  481.                         BL      row specifier
  482.                                 0       user set - DL = number of rows
  483.                                 1       14 rows
  484.                                 2       25 rows
  485.                                 3       43 rows
  486.                 AL      22h     ROM 8 by 14 set
  487.                         BL      row specifier
  488.                 AL      23h     ROM 8 by 8 double dot
  489.                         BL      row specifier
  490.                 AL      24h     load 8x16 graphics characters (MCGA, VGA)
  491.                 AL      30h     return information
  492.                         BH      pointer specifier
  493.                                 0       int 1Fh pointer
  494.                                 1       int 44h pointer
  495.                                 2       ROM 8 by 14 character font pointer
  496.                                 3       ROM 8 by 8 double dot font pointer
  497.                                 4       ROM 8 by 8 DD font (top half)
  498.                                 5       ROM text alternate (9 by 14) pointer
  499. return  ES:BP   specified pointer value
  500.         CX      bytes/character
  501.         DL      character rows on screen
  502.  
  503.  
  504.  
  505. Function 12h    Alternate Select (EGA and after)
  506. entry   AH      12h
  507.         AL      00h     unknown
  508.                 01h     unknown
  509.                 02h     select 400 line mode                            (VGA)
  510.         BL      10h     return EGA information
  511.                 20h     select alternate print screen routine
  512.                 30h     select vertical resolution for text modes       (VGA)
  513.                 31h     enable/disable default palette loading    (MCGA, VGA)
  514.                 32h     enable/disable video addressing           (MCGA, VGA)
  515.                 33h     enable/disable default gray scale summing (MCGA, VGA)
  516.                 34h     enable/diable text cursor emulation             (VGA)
  517.                 35h     display-switch interface
  518. return  BH      00h     if color mode is in effect
  519.                 01h     if mono mode is in effect
  520.         BL      00h     if 64k EGA memory
  521.                 01h     if 128k EGA memory
  522.                 02h     if 192k EGA memory
  523.                 03h     if 256k EGA memory
  524.         CH      feature bits
  525.         CL      switch settings
  526.  
  527.  
  528. Function 13h    Write String, Don't Move Cursor              (AT, XT/286, PS/2)
  529. entry   AH      13h
  530.         AL      00h
  531.         BH      display page number
  532.         BL      attribute
  533.         CX      length of string
  534.         DX      starting cursor position
  535.         ES:BP   pointer to start of string
  536. return  none
  537.  
  538.  
  539. Function 13h    Write String, Move Cursor                    (AT, XT/286, PS/2)
  540. entry   AH      13h
  541.         AL      01h
  542.         BH      display page number
  543.         BL      attribute
  544.         DX      starting cursor position
  545.         CX      length of string
  546.         ES:BP   pointer to start of string
  547. return  none
  548.  
  549.  
  550. Function 13h    Write String of Alternating Characters and Attributes;
  551.                 Don't Move Cursor                            (AT, XT/286, PS/2)
  552. entry   AH      13h
  553.         AL      02h
  554.                 bit 0: set in order to move cursor after write
  555.                 bit 1: set if string contains alternating chars and attributes
  556.         BH      display page number
  557.         BL      attribute if AL bit 1 clear
  558.         CX      length of string
  559.         DH      row of starting cursor position
  560.         DL      column of starting cursor position
  561.         ES:BP   pointer to start of string
  562. return  none
  563.  
  564.  
  565. Function 13h    Write String of Alternating Characters and Attributes;
  566.                 Move Cursor                                  (AT, XT/286, PS/2)
  567. entry   AH      13h
  568.         AL      03h
  569.             bit 0: set in order to move cursor after write
  570.             bit 1: set if string contains alternating characters and attributes
  571.         BH      display page number
  572.         BL      attribute if AL bit 1 clear
  573.         CX      length of string
  574.         DH,DL   row,column of starting cursor position
  575.         ES:BP   pointer to start of string
  576. return  none
  577. note    Recognizes CR, LF, BS, and bell
  578.  
  579.  
  580. Function 14h    Load LCD Character Font                      (Convertible)
  581. entry   AH      14h
  582.         AL      00h     load user specified font
  583.  
  584.         BH      number of bytes per character
  585.         BL      00h     load main font (block 0)
  586.                 01h     load alternate font (block 1)
  587.  
  588.         AL      01h     load system ROM default font
  589.         BL      00h     load main font (block 0)
  590.                 01h     load alternate font (block 1)
  591.  
  592.         AL      02h     set mapping of LCD high intensity attribute
  593.         BL      00h     ignore high intensity attribute
  594.                 01h     map high intensity to underscore
  595.                 02h     map high intensity to reverse video
  596.                 03h     map high intensity to seleected alternate font
  597.         ES:DI   pointer to character font
  598.         CX      number of characters to store
  599.         DX      character offset into RAM font area
  600.  
  601.  
  602. Function 15h    Return Physical Display Parameters           (Convertible)
  603. return  AX      Alternate display adapter type
  604.         ES:DI   pointer to parameter table:
  605.                 word #  information
  606.                 01h     monitor model number
  607.                 02h     vertical pixels per meter
  608.                 03h     horizontal pixels per meter
  609.                 04h     total number of vertical pixels
  610.                 05h     total number of horizontal pixels
  611.                 06h     horizontal pixel separation in micrometers
  612.                 07h     vertical pixel separation in micrometers
  613.  
  614.  
  615. Function 1Ah    Display Combination Code                     (PS/2)
  616.                 Using the compatibility BIOS of the PS/2 Models 50, 60, 80 there
  617.                 is a way to determine which video controller and attached
  618.                 display are on the system.  The Display Combination Code (DCC)
  619.                 is a Video BIOS function that provides the capability.
  620. entry   AH      1Ah
  621.         AL      00h     read display combination code
  622.                 01h     write display combination code
  623. return  AL      1Ah     indicates Compatibility BIOS is supported,
  624.                          any other value is invalid
  625.         BH      alternate display device
  626.                 where:
  627.                 00h     no display
  628.                 01h     IBM monochrome display and printer adapter
  629.                 02h     IBM color/graphics monitor adapter
  630.                 03h     reserved
  631.                 04h     IBM EGA (color display)
  632.                 05h     IBM EGA (monochrome)
  633.                 06h     IBM PGA
  634.                 07h     VGA (analog monochrome display)
  635.                 08h     VGA (analog color display)
  636.                 09h     reserved
  637.                 0Ah     reserved
  638.                 0Bh     IBM PS/2 Model 30 (analog monochrome display)
  639.                 0Ch     IBM PS/2 Model 30 (analog color display)
  640.         BL      active display device
  641.  
  642.  
  643. Function 1Bh    Functionality/State Information              (MCGA, VGA)
  644. entry   AH      1Bh
  645. return  unknown
  646.  
  647.  
  648. Function 1Ch    Save/Restore Video State                     (VGA)
  649. entry   AH      1Ch
  650.         AL      00h     return state buffer size
  651.                 01h     save video state
  652.                 02h     restore video state
  653. return  unknown
  654. note    VGA only
  655.  
  656.  
  657. Function 70h    Get Video RAM Address                        (Tandy 1000)
  658. entry   AH      70h
  659. return  AX      segment addresses of the following
  660.                 BX      offset address of green plane
  661.                 CX      segment address of green plane
  662.                 DX      segment address of red/blue plane
  663. note    (red offset = 0, blue offset = 4000)
  664.  
  665.  
  666. Function 71h    Get INCRAM Addresses                         (Tandy 1000)
  667. entry   AH      71h
  668. return  AX      segment address of the following
  669.                 BX = segment address of INCRAM
  670.                 CX = offset address of INCRAM
  671.  
  672.  
  673. Function 72h    Scroll Screen Right                          (Tandy 1000)
  674. entry   AH      72h
  675.         AL      number of columns blanked at left of page
  676.                 00h     blank window
  677.         BH      attributes to be used on blank columns
  678.         CH,CL   row, column address of upper left corner
  679.         DH,DL   row, column address of lower right corner
  680.  
  681.  
  682. Function 73h    Scroll Screen Left                           (Tandy 1000)
  683. entry   AH      73h
  684.         AL      number of columns blanked at right of page
  685.                 00h     blank window
  686.         BH      attributes to be used on blank columns
  687.         CH,CL   row, column address of upper left corner
  688.         DH,DL   row, column address of lower right corner
  689.  
  690.  
  691. Function 81h    DESQview video - Get something?
  692. entry   AH      81h
  693.         DX      4456h ('DV')
  694. return  ES    segment of DESQview data structure for video buffer
  695.         byte ES:[0] = current window number
  696. note    This function is probably meant for internal use only, due to the
  697.         magic value required in DX
  698.  
  699.  
  700. Function 82h    DESQview - Get Current Window Info
  701. entry   AH      82h
  702.         DX      4456h ('DV')
  703. return  AH      unknown
  704.         AL      current window number
  705.         BH      unknown
  706.         BL      direct screen writes
  707.                 0       program does not do direct writes
  708.                 1       program does direct writes, so shadow buffer not usable
  709.         CH      unknown
  710.         CL      current video mode
  711.         DS      segment in DESQview for data structure
  712.                 in DV 2.00,
  713.                   byte DS:[0] = window number
  714.                   word DS:[1] = segment of other data structure
  715.                   word DS:[3] = segment of window's object handle
  716.         ES      segment of DESQview data structure for video buffer
  717. note    This function is probably meant for internal use only, due to the magic
  718.         value required in DX
  719.  
  720.  
  721. Function 0F0h   Microsoft Mouse driver EGA support - Read One Register
  722. entry   AH      0F0h
  723.         BL      register number
  724.         DX      group index
  725.             Pointer/data chips
  726.                00h CRT Controller (25 reg) 3B4h mono modes, 3D4h color modes
  727.                08h Sequencer (5 registers) 3C4h
  728.                10h Graphics Controller (9 registers) 3CEh
  729.                18h Attribute Controller (20 registers) 3C0h
  730.             Single registers
  731.                20h Miscellaneous Output register 3C2h
  732.                28h Feature Control register (3BAh mono modes, 3DAh color modes)
  733.                30h Graphics 1 Position register 3CCh
  734.                38h Graphics 2 Position register 3CAh
  735. return  BL      data
  736.  
  737.  
  738. Function 0F1h   Microsoft Mouse driver EGA support - Write One Register
  739. entry   AH      0F1h
  740.         DX      group index (see function F0h)
  741.         BL      register number
  742.         BH      value to write
  743. return  BL      data
  744.  
  745.  
  746. Function 0F2h   Microsoft Mouse driver EGA support - Read Register Range
  747. entry   AH      0F2h
  748.         CH      starting register number
  749.         CL      number of registers (>1)
  750.         DX      group index
  751.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  752.                 08h     Sequencer 3C4h
  753.                 10h     Graphics Controller 3CEh
  754.                 18h     Attribute Controller 3C0h
  755.         ES:BX   pointer to buffer, CL bytes
  756.  
  757.  
  758. Function 0F3h   Microsoft Mouse driver EGA support - Write Register Range
  759. entry   AH      0F3h
  760.         CH      starting register
  761.         CL      number of registers (>1)
  762.         DX      group index
  763.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  764.                 08h     Sequencer 3C4h
  765.                 10h     Graphics Controller 3CEh
  766.                 18h     Attribute Controller 3C0h
  767.         ES:BX   pointer to buffer, CL bytes
  768.  
  769.  
  770. Function 0F4h   Microsoft Mouse driver EGA support - Read Register Set
  771. entry   AH      0F4h
  772.         CX      number of registers (>1)
  773.         ES:BX   pointer to table of records in this format:
  774.              bytes 1-2 group index
  775.                 Pointer/data chips
  776.                    00h CRTC (3B4h mono modes, 3D4h color modes)
  777.                    08h Sequencer 3C4h
  778.                    10h Graphics Controller 3CEh
  779.                    18h Attribute Controller 3C0h
  780.                 Single registers
  781.                    20h Miscellaneous Output register 3C2h
  782.                    28h Feature Control register (3BAh mono modes, 3DAh color)
  783.                    30h Graphics 1 Position register 3CCh
  784.                    38h Graphics 2 Position register 3CAh
  785.              byte 3 register number (0 for single registers)
  786.              byte 4 register value
  787.  
  788.  
  789. Function 0F5h   Microsoft Mouse driver EGA support - Read Register Set
  790. entry   AH      0F5h
  791.         CX      number of registers (>1)
  792.         ES:BX   pointer to table of records in this format:
  793.              bytes 1-2 port number
  794.                 Pointer/data chips
  795.                    00h CRTC (3B4h mono modes, 3D4h color modes)
  796.                    08h Sequencer 3C4h
  797.                    10h Graphics Controller 3CEh
  798.                    18h Attribute Controller 3C0h
  799.                 Single registers
  800.                    20h Miscellaneous Output register 3C2h
  801.                    28h Feature Control register (3BAh mono modes, 3DAh color)
  802.                    30h Graphics 1 Position register 3CCh
  803.                    38h Graphics 2 Position register 3CAh
  804.              byte 3 register number (0 for single registers)
  805.              byte 4 register value
  806.  
  807.  
  808. Function 0F6h   Microsoft Mouse driver EGA support
  809.                 Revert to Default Registers
  810. entry   AH      0F6h
  811. return  unknown
  812.  
  813.  
  814. Function 0F7h   Microsoft Mouse driver EGA support
  815.                 Define Default Register Table
  816. entry   AH      0F7h
  817.         DX      port number
  818.            Pointer/data chips
  819.               00h CRTC (3B4h mono modes, 3D4h color modes)
  820.               08h Sequencer 3C4h
  821.               10h Graphics Controller 3CEh
  822.               18h Attribute Controller 3C0h
  823.            Single registers
  824.               20h Miscellaneous Output register 3C2h
  825.               28h Feature Control register (3BAh mono modes, 3DAh color modes)
  826.               30h Graphics 1 Position register 3CCh
  827.               38h Graphics 2 Position register 3CAh
  828.         ES:BX address of table of one byte entries, one byte
  829.               to be written to each register
  830.  
  831.  
  832. Function 0FAh   Microsoft Mouse driver EGA support - Interrogate Driver
  833. entry   AH      0FAh
  834.         BX      00h
  835. return  BX      00h     if mouse driver not present
  836.         ES:BX   pointer to EGA Register Interface version number, if present:
  837.                 byte 1  major release number
  838.                 byte 2  minor release number
  839.  
  840.  
  841. Function 0FEh   Get Alternate Screen Buffer Address (text mode only)
  842.                                                     (Topview/DesQview/Taskview)
  843. entry   AH     0FEh
  844.         ES:DI  segment:offset of assumed video buffer
  845. return: ES:DI  segment:offset of actual video buffer
  846. note 1) This alternate video buffer can be written to directly, in the same
  847.         manner as writing to B:000 or B:800. The MT program will manage the
  848.         actual display.
  849.      2) There is no need to synchronize vertical retrace when writing to the
  850.         alternate buffer; this is managed by the MT program
  851.      3) If TopView or DESQview is not running, ES:DI is returned unchanged.
  852.      4) TopView requires that function 0FFh be called every time you write into
  853.         the buffer to tell TopView that something changed
  854.  
  855.  
  856. Function 0FFh   Update Real Display (text mode only)                  (TopView)
  857.                 Update Video Buffer                 (Topview/DesQview/Taskview)
  858. entry   AH      0FFh
  859.         CX      number of sequential characters that have been modified
  860.         DI      offset of first character that has been modified
  861.         ES      segment of video buffer
  862. return  unknown
  863. note 1) DesQview supports this call, but does not require it
  864.      2) Avoid CX=0
  865.  
  866.  
  867.  
  868.  
  869. Interrupt 11h   Equipment Check
  870. (0:0044h)       fetch a code describing active peripherals.
  871. entry   AH      11h
  872. return  AX      Equipment listing word          Bits are:
  873.                 0       number of floppy drives
  874.                         0       no drives
  875.                         1       bootable diskette installed
  876.                 1       math chip
  877.                         0       no math coprocessor (80x87) present
  878.                         1       math coprocessor (80x87) present
  879.          (PS/2) 2       0       mouse not installed
  880.                         1       mouse installed
  881.           (PC)  2,3     system board RAM
  882.                         0,0     16k    (PC-0, PC-1)
  883.                         1,1     64k    (PC-2, XT)
  884.                         note 1) not commonly used. Set both bits to 1
  885.                              2) both bits always 1 in AT
  886.                 4,5     initial video mode
  887.                         0,0     no video installed (use with dumb terminal)
  888.                         0,1     40x25 color      (CGA)
  889.                         1,0     80x25 color      (CGA)
  890.                         1,1     80x25 monochrome (MDA or Hercules)
  891.                 6,7     number of diskette drives (only if bit 0  1)
  892.                         0,0     1 drives
  893.                         0,1     2 drives
  894.                         1,0     3 drives
  895.                         1,1     4 drives
  896.                 8       0       DMA present
  897.                         1       no DMA on system (PCjr, some Tandy 1000s)
  898.                 9,A,B   number of RS232 serial ports (0-3)
  899.                         0,0,0   none
  900.                         0,0,1   1
  901.                         0,1,0   2
  902.                         0,1,1   3
  903.                         1,0,0   4
  904.                 C       0       no game I/O attached
  905.                         1       game I/O attached (default for PCjr)
  906.                 D       serial accessory installation
  907.                         0       no serial accessories installed
  908.                         1       Convertible - internal modem installed
  909.                         1       PCjr - serial printer attached
  910.                 E,F     number of parallel printers
  911.                         0,0     none
  912.                         0,1     one   (LPT1, PRN)
  913.                         1,0     two   (LPT2)
  914.                         1,1     three (LPT3)
  915.                         note    Models before PS/2 would allow a fourth
  916.                                 parallel printer. Remapping of the BIOS in the
  917.                                 PS/2s does not allow the use of LPT4.
  918.  
  919.  
  920.  
  921. Interrupt 12h   Memory Size
  922. (0:0048h)       get system memory
  923. return  AX      number of contiguous 1K RAM blocks
  924. note 1) This service does not depend on the setting of the motherboard switches
  925.      2) This is the same value stored in absolute address 04:13h
  926.  
  927.  
  928.  
  929. Interrupt 13h  Disk I/O - access the disk drives (floppy and hard disk)
  930. (0:004Ch)      does not try rereading disk if an error is returned
  931.  
  932.  
  933. Function 00h    Reset - reset the disk controller chip
  934. entry   AH      00h
  935.         DL      drive (if bit 7 is set both hard disks and floppy disks reset)
  936. return  AH      status
  937. note 1) Forces controller chip to recalibrate read/write heads
  938.      2) Some systems (Sanyo 55x) this resets all drives
  939.  
  940.  
  941. Function 01h    Get Status of disk system
  942. entry   AH      01h
  943.         DL      drive (hard disk if bit 7 set)
  944. return  AL      status of most recent operation
  945.                 00h     successful completion
  946.                 01h     bad command
  947.                 02h     address mark not found
  948.                 03h     tried to write on write-protected disk
  949.                 04h     sector not found
  950.                 05h     reset failed (hard disk)
  951.                 06h     diskette removed or changed
  952.                 07h     bad parameter table (hard disk)
  953.                 08h     DMA overrun
  954.                 09h     attempt to DMA across 64K boundary
  955.                 0Ah     bad sector detected (hard disk)
  956.                 0Bh     bad track detected (hard disk)
  957.                 0Ch     unsupported track
  958.                 0Dh     invalid number of sectors on format (hard disk)
  959.                 0Eh     control data address mark detected (hard disk)
  960.                 0Fh     DMA arbitration error (hard disk)
  961.                 10h     bad CRC/EEC on read
  962.                 11h     data ECC corrected
  963.                 20h     controller failure
  964.                 40h     seek failed
  965.                 80h     timeout
  966.                 0AAh    drive not ready (hard disk)
  967.                 0BBh    undefined error (hard disk)
  968.                 0CCh    write fault     (hard disk)
  969.                 0E0h    status error    (hard disk)
  970.                 0FFh    sense operation failed (hard disk)
  971.  
  972.  
  973. Function 02h    Read Sectors - read one or more sectors from diskette
  974. entry   AH      02h
  975.         AL      number of sectors to read
  976.         BX      address of buffer (ES=segment)
  977.         CH      track number (0-39 or 0-79 for floppies)
  978.                 (for hard disk, bits 8,9 in high bits of CL)
  979.         CL      sector number (1 to 18, not value checked)
  980.         DH      head number (0 or 1)
  981.         DL      drive (0=A, 1=B, etc.) (bit 7=0)  (drive 0-7)
  982.         ES:BX   address to store/fetch data  (buffer to fill)
  983.        [0000:0078]  dword pointer to diskette parms
  984. return  CF      clear (0) for successful
  985.                 set (1) failure
  986.                 AH      status (00h, 02h, 03h, 04h, 08h, 09h, 10h, 0Ah, 20h,
  987.                         40h, 80h)
  988.         AL      number of sectors transferred
  989. note 1) Number of sectors begins with 1, not 0
  990.      2) Trying to read zero sectors is considered a programming error; results
  991.         are not defined
  992.  
  993.  
  994. Function 03h    Write Sectors - write from memory to disk
  995. entry   AH      03h
  996.         AL      number of sectors to write (1-8)
  997.         CH      track number (for hard disk, bits 8,9 in high bits of CL)
  998.         CL      beginning sector number
  999.                 (if hard disk, high two bits are high bits of track #)
  1000.         DH      head number
  1001.         DL      drive number (0-7)
  1002.         ES:BX   address of buffer for data
  1003. return  CF      set if error
  1004.                 AH      status (see above)
  1005.         AL      number of sectors written
  1006. note 1) Number of sectors begins with 1, not 0
  1007.      2) Trying to write zero sectors is considered a programming error; results
  1008.         are not defined
  1009.  
  1010.  
  1011. Function 04h    Verify - verify that a write operation was successful
  1012. entry   AH      04h
  1013.         AL      number of sectors to verify (1-8)
  1014.         CH      track number  (for hard disk, bits 8,9 in high bits of CL)
  1015.         CL      beginning sector number
  1016.         DH      head number
  1017.         DL      drive number (0-7)
  1018. return  CF      set on error
  1019.                 AH      status (see above)
  1020.         AL      number of sectors verified
  1021.  
  1022.  
  1023. Function 05h    Format Track - write sector ID bytes for 1 track
  1024. entry   AH      05h
  1025.         AL      number of sectors to create on this track
  1026.         CH      track (or cylinder) number
  1027.         CL      sector number
  1028.         DH      head number (0, 1)
  1029.         DL      drive number (0-3)
  1030.         ES:BX   pointer to 4-byte address field (C-H-R-N)
  1031.                 byte 1 = (C) cylinder or track
  1032.                 byte 2 = (H) head
  1033.                 byte 3 = (R) sector
  1034.                 byte 4 = (N) bytes/sector (0 = 128, 1 = 256, 2 = 512, 3 = 1024)
  1035. return  CF      set if error occurred
  1036.                 AH      status code (see above)
  1037. note    Not valid for ESDI hard disks on PS/2
  1038.  
  1039.  
  1040. Function 06h    Hard Disk - format track and set bad sector flags
  1041.                                                      (PC2, PC-XT, and Portable)
  1042. entry   AH      06h
  1043.         AL      interleave value (XT only)
  1044.         CH      cylinder number (bits 8,9 in high bits of CL)
  1045.         CL      sector number
  1046.         DH      head
  1047.         DL      drive
  1048.         ES:BX   512 byte format buffer
  1049.                 the first 2*(sectors/track) bytes contain f,n for each sector
  1050.                    f  00Fh for good sector
  1051.                       80h for bad sector
  1052.                    n  sector number
  1053. return  AH      status code
  1054.  
  1055.  
  1056. Function 07h    Hard Disk - format the drive starting at the desired track
  1057.                                                       (PC2, PC-XT and Portable)
  1058. entry   AH      07h
  1059.         AL      interleave value (XT only) (01h-10h)
  1060.         CH      cylinder number (bits 8,9 in high bits of CL) (00h-03FFh)
  1061.         CL      sector number
  1062.         DH      head number (0-7)
  1063.         DL      drive number (80h-87h, 80h=C, 81h=D,...)
  1064.         ES:BX   format buffer, size = 512 bytes
  1065.                 the first 2*(sectors/track) bytes contain f,n for each sector
  1066.                 f=00h for good sector
  1067.                   80h for bad sector
  1068.                 n=sector number
  1069. return  AH      status code (see above)
  1070.  
  1071.  
  1072. Function 08h    Read Drive Parameters             (XT, CONV, AT, XT/286, PS/2)
  1073. entry   AH      08h
  1074.         DL      drive number (0-2)
  1075. return  CF      set on error
  1076.                 AH      status code (see above)
  1077.         BL      drive type (see AH=17h below) (AT/PS2 floppies only)
  1078.         CH      maximum useable value for cylinder number
  1079.         CL      maximum useable value for sector number or cylinder number
  1080.         DH      maximum usable value for head number
  1081.         DL      number of consecutive acknowledging drives (0-2)
  1082.         ES:DI   drive parameter table
  1083.  
  1084.  
  1085. Function 09h    Initialize Two Fixed Disk Base Tables    (XT, AT, XT/286, PS/2)
  1086.                 (install nonstandard drive)
  1087. entry   AH      09h
  1088. return  CF      set on error
  1089.                 AH      status code (see above)
  1090.                 data block definitions:
  1091.                 +0   maximum number of cylinders (dw)
  1092.                 +2   maximum number of heads (db)
  1093.                 +3   starting reduced write current cylinder  (dw - XT only)
  1094.                 +5   starting write precomp cylinder (dw)
  1095.                 +7   maximum ECC data burst length (db - XT only)
  1096.                 +8   control byte: Bits
  1097.                      0,1,2 ─ drive option
  1098.                      3,4,5 - always zero
  1099.                          6 - disable ECC retries
  1100.                          7 - disable access retries
  1101. note 1) Int 41h points to table for drive 0
  1102.      2) Int 46h points to table for drive 1
  1103.      3) 41h used by XT, 41h and 46h used by AT
  1104.  
  1105.  
  1106. Function 0Ah    Read Long   (Hard disk)                 (XT, AT, XT/286, PS/2)
  1107. entry   AH      0Ah
  1108.         CH      cylinder number (bits 8,9 in high bits of CL)
  1109.         CL      sector number
  1110.         DL      drive ID
  1111.         DH      head number
  1112.         ES:BX   pointer to buffer to fill
  1113. return  CF      set on error
  1114.                 AH      status code (see above)
  1115.         AL      number of sectors actually transferred
  1116. note 1) A "long" sector includes a 4 byte EEC (Extended Error Correction) code
  1117.      2) Used for diagnostics only on PS/2 systems
  1118.  
  1119.  
  1120. Function 0Bh    Write Long                              (XT, AT, XT/286, PS/2)
  1121. entry   AH      0Bh
  1122.         CH      cylinder (bits 8,9 in high bits of CL)
  1123.         CL      sector number
  1124.         DH      head number
  1125.         DL      drive ID
  1126.         ES:BX   pointer to buffer containing data
  1127. return  CF      set on error
  1128.                 AH      status code (see above)
  1129.         AL      number of sectors actually transferred
  1130. note 1) A "long" sector includes a 4 byte EEC (Extended Error Correction) code
  1131.      2) Used for diagnostics only on PS/2 systems
  1132.  
  1133.  
  1134. Function 0Ch    Seek To Cylinder                (except PC, PCjr)
  1135. entry   AH      0Ch
  1136.         CH      cylinder number (bits 8,9 in high bits of CL)
  1137.         DH      head number
  1138.         DL      drive ID
  1139. return  CF      set on error
  1140.                 AH      status code (see above)
  1141. note 1) Positions heads over a particular cylinder
  1142.  
  1143.  
  1144. Function 0Dh    Alternate Disk Reset                    (except PC, PCjr)
  1145. entry   AH      0Dh
  1146.         DL      drive ID
  1147. return  CF      set on error
  1148.         AH      status code (see above)
  1149. note    Not for PS/2 ESDI hard disks
  1150.  
  1151.  
  1152. Function 0Eh    Read Sector Buffer                         (XT, Portable PS/2)
  1153. entry   AH      0Eh
  1154.         AL      number of sectors
  1155.         CH      cylinder (bits 8,9 in top two bits of CL)
  1156.         CL      sector number
  1157.         DH      head number
  1158.         DL      drive number
  1159.         ES:BX   pointer to buffer
  1160. return  CF      set on error
  1161.                 AH      status code (see above)
  1162.         AL      number of sectors actually transferred
  1163. note 1) Transfers controller's sector buffer.  No data is read from the drive
  1164.      2) Used for diagnostics only on PS/2 systems
  1165.  
  1166.  
  1167. Function 0Fh    Write sector buffer                          (XT, Portable)
  1168. entry   AH      0Fh
  1169.         AL      number of sectors
  1170.         CH      cylinder (bits 8,9 in top two bits of CL)
  1171.         CL      sector number
  1172.         DH      head number
  1173.         DL      drive number
  1174.         ES:BX   pointer to buffer
  1175. return  CF      set if error
  1176.                 AH      status code
  1177.         AL      number of sectors actually transferred
  1178. note 1) Should be called before formatting to initialize the controller's
  1179.         sector buffer.
  1180.      2) Used for diagnostics only on PS/2 systems
  1181.  
  1182.  
  1183. Function 10h    Test For Drive Ready
  1184. entry   AH      10h
  1185.         DL      drive ID
  1186. return  CF      set on error
  1187.                 AH      status code (see above)
  1188.  
  1189.  
  1190. Function 11h    Recalibrate Drive
  1191. entry   AH      11h
  1192.         DL      drive ID
  1193. return  CF      set on error
  1194.                 AH      status code (see above)
  1195.  
  1196.  
  1197. Function 12h    Controller RAM Diagnostic                (XT, Portable, PS/2)
  1198. entry   AH      12h
  1199. return  CF      set on error
  1200.                 AH      status code (see AH=1 above)
  1201. note    Used for diagnostics only on PS/2 systems
  1202.  
  1203.  
  1204. Function 13h    Drive Diagnostic                             (XT, Portable)
  1205. entry   AH      13h
  1206. return  CF      set on error
  1207.                 AH      status code (see above)
  1208. note    Used for diagnostics only on PS/2 systems
  1209.  
  1210.  
  1211. Function 14h    Controller Internal Diagnostic               (AT, XT/286)
  1212. entry   AH      14h
  1213. return  CF      set on error
  1214.         AH      status code (see above)
  1215. note 1) OEM is Western Digital 1003-WA2 hard/floppy combination controller
  1216.         in AT and XT/286.
  1217.      2) Used for diagnostics only in PS/2 systems
  1218.  
  1219.  
  1220. Function 15h    Get Disk Type                                (except PC and XT)
  1221. entry   AH      15h
  1222.         DL      drive ID
  1223. return  AH      disk type
  1224.                 00h     no drive is present
  1225.                 01h     diskette, no change detection present
  1226.                 02h     diskette, change detection present
  1227.                 03h     fixed disk
  1228.         CX:DX   number of 512-byte sectors when AH = 03h
  1229.  
  1230.  
  1231. Function 16h    Change of Disk Status (diskette)             (except PC and XT)
  1232. entry   AH      16h
  1233. return  AH      disk change status
  1234.                 00h     no disk change
  1235.                 01h     disk changed
  1236.         DL      drive that had disk change
  1237.  
  1238.  
  1239. Function 17h    Set Disk Type for Format (diskette)          (except PC and XT)
  1240. entry   AH      17h
  1241.         AL      00h     no disk
  1242.                 01h     360kb diskette in 360Kb drive
  1243.                 02h     360kb diskette in 1.2M drive
  1244.                 03h     1.2M diskette in 1.2M drive
  1245.                 04h     720kb diskette in 720Kb drive
  1246.         DL      drive number
  1247. return  AH      status of operation
  1248. note    This function is probably enhanced for the PS/2 series to detect
  1249.         1.44 in 1.44 and 720k in 1.44.
  1250.  
  1251.  
  1252. Function 18h    Set Media Type For Format  (diskette)        (AT, XT/286, PS/2)
  1253. entry   AH      18h
  1254.         CH      lower 8 bits of number of tracks
  1255.         CL      high 2 bits of number of tracks (6,7) sectors per track
  1256.                 (bits 0-5)
  1257.         DL      drive number
  1258. return  AH      00h      if requested combination supported
  1259.                 01h      if function not available
  1260.                 0Ch      if not suppported or drive type unknown
  1261.                 80h      if there is no media in the drive
  1262.         ES:DI   pointer to 11-byte parm table
  1263.  
  1264.  
  1265. Function 19h    Park Hard Disk Heads                         (XT/286, PS/2)
  1266. entry   AH      19h
  1267.         DL      drive
  1268. return  CF      set on error
  1269.                 AH      error code
  1270.  
  1271.  
  1272. Function 1Ah    ESDI Hard Disk - Format                         (PS/2)
  1273. entry   AH      1Ah
  1274.         AL      defect table count
  1275.         CL      format modifiers
  1276.                 bit 0:  ignore primary defect map
  1277.                 bit 1:  ignore secondary defect map
  1278.                 bit 2:  update secondary defect map
  1279.                 bit 3:  perform surface analysis
  1280.                 bit 4:  generate periodic interrupt
  1281.         DL      drive
  1282.         ES:BX   pointer to defect table
  1283. return  CF      set on error
  1284.                 AH      status (see AH=1 above)
  1285. note    If periodic interrupt selected, int 15h/AH=0Fh is called after each
  1286.         cylinder is formatted
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292. Interrupt 14h   Initialize and Access Serial Port For Int 14
  1293. (0:0050h)       the following status is defined:
  1294.  
  1295.         serial status byte:
  1296.         bits    0 delta clear to send
  1297.                 1 delta data set ready
  1298.                 2 trailing edge ring detector
  1299.                 3 delta receive line signal det.
  1300.                 4 clear to send
  1301.                 5 data set ready
  1302.                 6 ring indicator
  1303.                 7 receive line signal detect
  1304.  
  1305.         line status byte:
  1306.         bits    0 data ready
  1307.                 1 overrun error
  1308.                 2 parity error
  1309.                 3 framing error
  1310.                 4 break detect
  1311.                 5 transmit holding reg. empty
  1312.                 6 transmit shift register empty
  1313.                 7 time out  note: if bit 7 set then other bits are invalid
  1314.  
  1315.  All routines have AH=function number and DX=RS232 card number (0 based).
  1316. AL=character to send or received character on exit, unless otherwise noted.
  1317.  
  1318. entry   AH      00h     Initialize And Access Serial Communications Port
  1319.                         bit pattern: BBBPPSLL
  1320.                         BBB = baud rate:   110,150,300,600,1200,2400,4800,9600
  1321.                         PP  = parity:      01 = odd, 11 = even
  1322.                         S   = stop bits:   0 = 1, 1 = 2
  1323.                         LL  = word length: 10 = 7-bits, 11 = 8-bits
  1324.         AL      parms for initialization:
  1325.                 bit pattern:
  1326.                 0       word length
  1327.                 1       word length
  1328.                 2       stop bits
  1329.                 3       parity
  1330.                 4       parity
  1331.                 5       baud rate
  1332.                 6       baud rate
  1333.                 7       baud rate
  1334.                 word length     10      7 bits
  1335.                                 11      8 bits
  1336.                 stop bits       0       1 stop bit
  1337.                                 1       2 stop bits
  1338.                 parity          00      none
  1339.                                 01      odd
  1340.                                 11      even
  1341.                 baud rate       000     110 baud
  1342.                                 001     150 baud
  1343.                                 010     300 baud
  1344.                                 011     600 baud
  1345.                                 100     1200 baud
  1346.                                 101     2400 baud
  1347.                                 110     4800 baud
  1348.                                 111     9600 baud  (4800 on PCjr)
  1349.         DX      port number
  1350. return  AH      line status
  1351.         AL      modem status
  1352.  
  1353.  
  1354. Function 01h    Send Character in AL to Comm Port DX (0 or 1)
  1355. entry   AH      01h
  1356.         AL      character
  1357.         DX      port number (0 or 1)
  1358. return  AH      RS232 status code
  1359.                 bit     0       data ready
  1360.                         1       overrun error
  1361.                         2       parity error
  1362.                         3       framing error
  1363.                         4       break detected
  1364.                         5       transmission buffer register empty
  1365.                         6       transmission shift register empty
  1366.                         7       timeout
  1367.         AL      modem status
  1368.                 bit
  1369.                         0       delta clear-to-send
  1370.                         1       delta data-set-ready
  1371.                         2       trailing edge ring detected
  1372.                         3       change, receive line signal detected
  1373.                         4       clear-to-send
  1374.                         5       data-set-ready
  1375.                         6       ring received
  1376.                         7       receive line signal detected
  1377.  
  1378.  
  1379. Function 02h    Wait For A Character From Comm Port DX
  1380. entry   AH      02h
  1381. return  AL      character received
  1382.         AH      error code (see above)(00h for no error)
  1383.  
  1384.  
  1385. Function 03h    Fetch the Status of Comm Port DX (0 or 1)
  1386. entry   AH      03h
  1387. return  AH      set bits (01h) indicate comm-line status
  1388.                 bit     7       timeout
  1389.                 bit     6       empty transmit shift register
  1390.                 bit     5       empty transmit holding register
  1391.                 bit     4       break detected ("long-space")
  1392.                 bit     3       framing error
  1393.                 bit     2       parity error
  1394.                 bit     1       overrun error
  1395.                 bit     0       data ready
  1396.         AL      set bits indicate modem status
  1397.                 bit     7       received line signal detect
  1398.                 bit     6       ring indicator
  1399.                 bit     5       data set ready
  1400.                 bit     4       clear to send
  1401.                 bit     3       delta receive line signal detect
  1402.                 bit     2       trailing edge ring detector
  1403.                 bit     1       delta data set ready
  1404.                 bit     0       delta clear to send
  1405.  
  1406.  
  1407. Function 04h    Extended Initialize                             (PC Convertible)
  1408. entry   AH      04h
  1409.         AL      break status
  1410.                 01h     if break
  1411.                 00h     if no break
  1412.         BH      parity
  1413.                 00h     no parity
  1414.                 01h     odd parity
  1415.                 02h     even parity
  1416.                 03h     stick parity odd
  1417.                 04h     stick parity even
  1418.         BL      number of stop bits
  1419.                 00h     one stop bit
  1420.                 01h     2 stop bits (1½ if 5 bit word length)
  1421.         CH      word length
  1422.                 00h     5 bits
  1423.                 01h     6 bits
  1424.                 02h     7 bits
  1425.                 03h     8 bits
  1426.         CL      baud rate
  1427.                 00h     110
  1428.                 01h     150
  1429.                 02h     300
  1430.                 03h     600
  1431.                 04h     1200
  1432.                 05h     2400
  1433.                 06h     4800
  1434.                 07h     9600
  1435.                 08h     19200
  1436. return  AL      modem status
  1437.         AH      line control status
  1438.  
  1439.  
  1440. Function 05h    Extended Communication Port Control             (PS/2)
  1441. entry   AH      05h
  1442.         AL      00h     read modem control register
  1443.                 return  BL      modem control reg (see AL=1)
  1444.         AL      01h     write modem control register
  1445.         BL      modem control register: (for AL=00 and AL=01)  bits
  1446.                 0       data terminal ready
  1447.                 1       request to send
  1448.                 2       out1
  1449.                 3       out2
  1450.                 4       loop
  1451.                 5,6,7   reserved
  1452. return  AH      status
  1453.  
  1454.  
  1455. Interrupt 15h   Cassette I/O
  1456. (0:0054h)       Renamed "System Services" on PS/2 line
  1457.  
  1458.  
  1459. Function 00h    Turn Cassette Motor On                          (PC, PCjr only)
  1460. entry   AH      00h
  1461. return  AH      86h     no cassette present
  1462.         CF      set on error
  1463. note    NOP for systems where cassette not supported
  1464.  
  1465.  
  1466. Function 01h    Turn Cassette Motor Off                         (PC, PCjr only)
  1467. entry   AH      01h
  1468. return  AH      86h     no cassette present
  1469.         CF      set on error
  1470. note    NOP for systems where cassette not supported
  1471.  
  1472.  
  1473. Function 02h    Read Blocks From Cassette                       (PC, PCjr only)
  1474. entry   AH      02h
  1475.         CX      count of bytes to read
  1476.         ES:BX   pointer to data buffer
  1477. return  CF      set on error
  1478.                 AH      error code
  1479.                         01h     CRC error
  1480.                         02h     bad tape signals
  1481.                         03h     no data found on tape
  1482.                         04h     no data
  1483.                         80h     invalid command
  1484.                         86h     no cassette present
  1485.         DX      count of bytes actually read
  1486.         ES:BX   pointer past last byte written
  1487. note 1) NOP for systems where cassette not supported
  1488.      2) Cassette operations normally read 256 byte blocks
  1489.  
  1490.  
  1491. Function 03h    Write Data Blocks to Cassette                   (PC, PCjr only)
  1492. entry   AH      03h
  1493.         CX      count of bytes to write
  1494.         ES:BX   pointer to data buffer
  1495. return  CF      set on error
  1496.                 AH      error code (see 02h)
  1497.         CX      0
  1498.         ES:BX   pointer to last byte written+1
  1499. note 1) NOP for systems where cassette not supported
  1500.      2) The last block is padded to 256 bytes with zeroes if needed
  1501.      3) No errors are returned by this service
  1502.  
  1503.  
  1504. Function 0Fh    ESDI Format Unit Periodic Interrupt          (PS/2 50, 60, 80)
  1505. entry   AH      0Fh
  1506.         AL      phase code
  1507.                 00h     reserved
  1508.                 01h     surface analysis
  1509.                 02h     formatting
  1510. return  CF      clear   if formatting should continue
  1511.                 set     if it should terminate
  1512. note    Called during ESDI drive formatting after each cylinder is completed
  1513.  
  1514.  
  1515. Function 10h    TopView API Function Calls                      (TopView)
  1516. entry   AX      00h     PAUSE   Give Up CPU Time
  1517.                         return  00h     after other processes run
  1518.                 01h     GETMEM  allocate "system" memory
  1519.                         BX      number of bytes to allocate
  1520.                         return  ES:DI pointer to block of memory
  1521.                 02h     PUTMEM  deallocate "system" memory
  1522.                         ES:DI   pointer to previously allocated block
  1523.                         return  block freed
  1524.                 03h     PRINTC  display character/attribute on screen
  1525.                         BH      attribute
  1526.                         BL      character
  1527.                         DX      segment of object handle for window
  1528.                         note    BX=0 does not display anything, it only
  1529.                                 positions the hardware cursor
  1530.                 10h     unknown
  1531.                         AL      04h thru 12h
  1532.                         return  TopView - unimplemented in DV 2.0x
  1533.                                 pops up "Programming error" window in DV 2.0x
  1534.                 11h     unknown
  1535.                 12h     unknown
  1536.                 13h     GETBIT  define a 2nd-level interrupt handler
  1537.                         ES:DI   pointer to FAR service routine
  1538.                         return  BX      bit mask indicating which bit was
  1539.                                         allocated
  1540.                                         0 if no more bits available
  1541.                 14h     FREEBIT undefine a 2nd-level interrupt handler
  1542.                         BX      bit mask from int 15/AH 13h
  1543.                 15h     SETBIT  schedule one or more 2nd-level interrupts
  1544.                         BX      bit mask for interrupts to post
  1545.                         return  indicated routines will be called at next ???
  1546.                 16h     ISOBJ   verify object handle
  1547.                         ES:DI   possible object handle
  1548.                         return   BX     -1 if ES:DI is a valid object handle
  1549.                                          0 if ES:DI is not
  1550.                 17h     TopView - unimplemented in DV 2.00
  1551.                         return  pops up "Programming Error" window in DV 2.00
  1552.                 18h     LOCATE  Find Window at a Given Screen Location
  1553.                         BH      column
  1554.                         BL      row
  1555.                         ES      segment of object handle for ???
  1556.                                 (0 = use default)
  1557.                         return  ES      segment of object handle for window
  1558.                                         which is visible at the indicated
  1559.                                         position
  1560.                 19h     SOUND   Make Tone
  1561.                         BX      frequency in Hertz
  1562.                         CX      duration in clock ticks (18.2 ticks/sec)
  1563.                         return  immediately, tone continues to completion
  1564.                         note    If another tone is already playing, the new tone
  1565.                                 does not start until completion of the previous
  1566.                                 one. In DV 2.00, it is possible to enqueue
  1567.                                 about 32 tones before the process is blocked
  1568.                                 until a note completes.
  1569.                                 In DV 2.00, the lowest tone allowed is 20 Hz
  1570.                 1Ah     OSTACK  Switch to Task's Internal Stack
  1571.                         return  stack switched
  1572.                 1Bh     BEGINC  Begin Critical Region
  1573.                         return  task-switching temporarily disabled
  1574.                         note    Will not task-switch until END CRITICAL REGION
  1575.                                 (AH=1Ch) is called
  1576.                 1Ch     ENDC    End Critical Region
  1577.                         return  task-switching enabled
  1578.                 1Dh     STOP    STOP TASK
  1579.                         ES      segment of object handle for task to be stopped
  1580.                                 (== handle of main window for that task)
  1581.                         return  indicated task will no longer get CPU time
  1582.                         note    At least in DV 2.00, this function is ignored
  1583.                                 unless the indicated task is the current task.
  1584.                 1Eh     START   Start Task
  1585.                         ES      segment of object handle for task to be started
  1586.                                 (== handle of main window for that task)
  1587.                         return  Indicated task is started up again
  1588.                 1Fh     DISPEROR Pop-Up Error Window
  1589.                         BX      bit fields:
  1590.                                 0-12    number of characters to display
  1591.                                 13,14   which mouse button may be pressed to
  1592.                                         remove window
  1593.                                         00      either
  1594.                                         01      left
  1595.                                         10      right
  1596.                                         11      either
  1597.                                 15      beep if 1
  1598.                         DS:DI   pointer to text of message
  1599.                         CH      width of error window (0 = default)
  1600.                         CL      height of error window (0 = default)
  1601.                         DX      segment of object handle
  1602.                         return  BX      status:
  1603.                                         1       left button pressed
  1604.                                         2       right button pressed
  1605.                                         27      ESC key pressed
  1606.                         note    Window remains on-screen until ESC or indicated
  1607.                                 mouse button is pressed
  1608.                 20h     TopView - unimplemented in DV 2.0x
  1609.                         return  pops up "Programming Error" window in DV 2.0x
  1610.                 21h     PGMINT  Interrupt Another Task
  1611.                         BX      segment of object handle for task to interrupt
  1612.                         DX:CX   address of FAR routine to jump to next time
  1613.                                 task is run
  1614.                         return  nothing?
  1615.                         note    The current ES, DS, SI, DI, and BP are passed
  1616.                                 to the FAR routine
  1617.                 22h     GETVER  Get Version
  1618.                         BX      00h
  1619.                         return  BX      nonzero, TopView or compatible loaded
  1620.                                 BH      minor version
  1621.                                 BL      major version
  1622.                         notes   TaskView returns BX = 0001h
  1623.                                 DESQview 2.0 returns BX = 0A01h
  1624.                 23h     POSWIN  Position Window
  1625.                         BX      segment of object handle for parent window
  1626.                                 within which to position the window (0 = full
  1627.                                 screen)
  1628.                         CH      # columns to offset from position in DL
  1629.                         CL      # rows to offset from position in DL
  1630.                         DL      bit flags
  1631.                                 0,1     horizontal position
  1632.                                         00      current
  1633.                                         01      center
  1634.                                         10      left
  1635.                                         11      right
  1636.                                 2,3     vertical position
  1637.                                         00      current
  1638.                                         01      center
  1639.                                         10      top
  1640.                                         11      bottom
  1641.                                 4       don't redraw screen if set
  1642.                                 5-7     not used
  1643.                         ES      segment of object handle for window to be
  1644.                                 positioned
  1645.                         return  nothing
  1646.                 24h     GETBUF  Get Virtual Screen Information
  1647.                         BX      segment of object handle for window (0=default)
  1648.                         return  CX      size of virtual screen in bytes
  1649.                                 DL      0 or 1, unknown
  1650.                                 ES:DI   address of virtual screen
  1651.                 25h     USTACK  Switch Back to User's Stack
  1652.                         return  stack switched back
  1653.                         note    Call only after int 15h,fn1Ah
  1654.                 26h
  1655.            thru 2Ah     DesQview (TopView?) - unimplemented in DV 2.0x
  1656.                         return  pops up "Programming Error" window in DV 2.0x
  1657.                 2Bh     POSTTASK  Awaken Task       DesQview 2.0 (TopView?)
  1658.                         BX      segment of object handle for task
  1659.                         return  nothing
  1660.                 2Ch     Start New Application in New Process
  1661.                         DesQview 2.0 (TopView?)
  1662.                         ES:DI   pointer to contents of .PIF/.DVP file
  1663.                         BX      size of .PIF/.DVP info
  1664.                         return  BX      segment of object handle for new task
  1665.                 2Dh     Keyboard Mouse Control       DesQview 2.0
  1666.                         BL      subfunction
  1667.                                 00h     determine whether using keyboard mouse
  1668.                                 01h     turn keyboard mouse on
  1669.                                 02h     turn keyboard mouse off
  1670.                         return  (calling BL was 00h)
  1671.                                 BL      0       using real mouse
  1672.                                         1       using keyboard mouse
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678. Function 20h    PRINT.COM  (DOS internal)        (AT, XT-286, PS/2 50+)
  1679. entry   AH      20h
  1680.         AL      subfunction
  1681.                 00h     unknown (PRINT)
  1682.                 01h     unknown (PRINT)
  1683.                 10h     sets up SysReq routine on AT, XT/286, PS/2
  1684.                 11h     completion of SysReq routine (software only)
  1685. note 1) AL=0 or 1 sets or resets some flags which affect what PRINT does when
  1686.         it tries to access the disk
  1687.  
  1688.  
  1689. Function 21h    Power-On Self Test (POST) Error Log             (PS/2 50+)
  1690. entry   AH      21h
  1691.         AL       00h    read POST log
  1692.                  01h    write POST log
  1693.                         BH      device ID
  1694.                         BL      error code
  1695. return  CF      set on error
  1696.         AH      status
  1697.                 00h    OK
  1698.                 01h    list full
  1699.                 80h    invalid cmd
  1700.                 86h    unsupported
  1701.         if function 00h:
  1702.                 BX      number of error codes stored
  1703.                 ES:DI   pointer to error log
  1704. note:   The log is a series of words, the first byte of which identifies the
  1705.         error code and the second the device.
  1706.  
  1707.  
  1708. Function 40h    Read/Modify Profiles                            (Convertible)
  1709. entry   AH      40h
  1710.         AL      00h     read system profile in CX,BX
  1711.                 01h     write system profile from CX, BX
  1712.                 02h     read internal modem profile in BX
  1713.                 03h     write internal modem profile from BX
  1714.         BX      profile info
  1715. return  BX      internal modem profile (from 02h)
  1716.         CX,BX   system profile (from 00h)
  1717.  
  1718.  
  1719. Function 41h    Wait On External Event                          (Convertible)
  1720. entry   AH      41h
  1721.         AL      condition type
  1722.                 bits 0-2: condition to wait for
  1723.                           0 any external event
  1724.                           1 compare and return if equal
  1725.                           2 compare and return if not equal
  1726.                           3 test and return if not zero
  1727.                           4 test and return if zero
  1728.                 bit 3:    reserved
  1729.                 bit 4:    1=port address, 0=user byte
  1730.                 bits 5-7: reserved
  1731.         BH      condition compare or mask value
  1732.                 condition codes:
  1733.                 0       any external event
  1734.                 1       compare and return if equal
  1735.                 2       compare and return if not equal
  1736.                 3       test and return if not zero
  1737.                 4       test and return if zero
  1738.         BL      timeout value times 55 milliseconds
  1739.                 0 if no time limit
  1740.         DX      I/O port address (if AL bit 4 = 1)
  1741.         ES:DI   pointer to user byte (if AL bit 4 = 0)
  1742.  
  1743.  
  1744. Function 42h    Request System Power Off                        (Convertible)
  1745. entry   AH      42h
  1746.         AL      00h     to use system profile
  1747.                 01h     to force suspend regardless of profile
  1748.  
  1749.  
  1750. Function 43h    Read System Status                              (Convertible)
  1751. entry   AH      43h
  1752. return  AL      status bits:
  1753.                 0       LCD detached
  1754.                 1       reserved
  1755.                 2       RS232/parallel powered on
  1756.                 3       internal modem powered on
  1757.                 4       power activated by alarm
  1758.                 5       standby power lost
  1759.                 6       external power in use
  1760.                 7       battery low
  1761.  
  1762.  
  1763. Function 44h    (De)activate Internal Modem Power               (Convertible)
  1764. entry   AH      44h
  1765.         AL      00h      to power off
  1766.                 01h      to power on
  1767.  
  1768.  
  1769. Function 4Fh    Keyboard Intercept                    (except PC, PCjr, and XT)
  1770. entry   AH      4Fh
  1771.         AL      scan code, CF set
  1772. return  AL      scan code, CF set if processing desired
  1773. note    Called by int 9 handler to translate scan codes
  1774.  
  1775.  
  1776. Function 80h    Device Open                                  (AT, XT/286, PS/2)
  1777. entry   AH      80h
  1778.         BX      device ID
  1779.         CX      process ID
  1780. return  CF      set on error
  1781.         AH      status
  1782.  
  1783.  
  1784. Function 81h    Device Close                                 (AT, XT/286, PS/2)
  1785. entry   AH      81h
  1786.         BX      device ID
  1787.         CX      process ID
  1788. return  CF      set on error
  1789.         AH      status
  1790.  
  1791.  
  1792. Function 82h    Program Termination                          (AT, XT/286, PS/2)
  1793.         AH      82h
  1794.         BX      device ID
  1795. return: CF      set on error
  1796.         AH      status
  1797. note    Closes all devices opened with function 80h
  1798.  
  1799.  
  1800. Function 83h    Event Wait                       (AT, XT/286, Convertible, PS/2)
  1801. entry   AH      83h
  1802.         AL      00h     to set interval
  1803.                 10h     to cancel
  1804.         CX,DX   number of microseconds to wait (granularity is 976 microseconds)
  1805.         ES:BX   pointer to memory flag (bit 7 is set when interval expires)
  1806.                 (pointer is to caller's memory)
  1807. return  CF      set (1) if function already busy
  1808.  
  1809.  
  1810. Function 84h    Read Joystick Input Settings                 (AT, XT/286, PS/2)
  1811. entry   AH      84h
  1812.         DX      00h     to read the current switch settings  (return in AL)
  1813.                 01h     to read the resistive inputs
  1814. return  AX      A(X) value
  1815.         BX      A(Y) value
  1816.         CX      B(X) value
  1817.         DX      B(Y) value
  1818.         AL      switch settings (bits 7-4)
  1819.  
  1820.  
  1821. Function 85h    System Request (SysReq) Key Pressed        (except PC, PCjr, XT)
  1822. entry   AH      85h
  1823. return  AL      00h      key pressed
  1824.                 01h      key released
  1825. note    Called by keyboard decode routine
  1826.  
  1827.  
  1828. Function 86h    Elapsed Time Wait                          (except PC, PCjr, XT)
  1829.         AH      86h
  1830.         CX,DX   number of microseconds to wait
  1831. return  CF      clear   after wait elapses
  1832.         CF      set     immediately due to error
  1833. note    Only accurate to 977 microseconds
  1834.  
  1835.  
  1836. Function 87h    Extended Memory Block Move              (286/386 machines only)
  1837.         AH      87h
  1838.         CX      number of words to move
  1839.         ES:SI   pointer to Global Descriptor Table (GDT)
  1840.                 offset 00h      null descriptor
  1841.                        08h      uninitialized, will be made into GDT descriptor
  1842.                        10h      descriptor for source of move
  1843.                        18h      descriptor for destination of move
  1844.                        20h      uninitialized, used by BIOS
  1845.                        28h      uninitialized, will be made into SS descriptor
  1846. return  CF      set on error
  1847.         AH      status
  1848.                 00h     source copied into destination
  1849.                 01h     parity error
  1850.                 02h     interrupt error
  1851.                 03h     address line 20 gating failed
  1852.  
  1853.  
  1854. Function 88h    Extended Memory Size Determine                (AT, XT/286, PS/2)
  1855. entry   AH      88h
  1856. return  AX      # of contiguous 1K blocks of memory starting at address 1024k
  1857.  
  1858.  
  1859. Function 89h    Switch Processor to Protected Mode            (AT, XT/286, PS/2)
  1860. entry   AH      89h
  1861.         BH      interrupt number of IRQ 8 (IRQ 9Fh use next 7 interrupts)
  1862.         BL      interrupt number of IRQ 0 (IRQ 17h use next 7 interrupts)
  1863.         CX      offset into protected mode CS to jump to
  1864.         DS:SI   pointer to Global Descriptor Table for protected mode
  1865.                 offset  00h     null descriptor
  1866.                         08h     GDT descriptor
  1867.                         10h     IDT descriptor
  1868.                         18h     DS
  1869.                         20h     ES
  1870.                         28h     SS
  1871.                         30h     CS
  1872.                         38h     uninitialized, used to build descriptor for
  1873.                                 BIOS CS
  1874. return  AH      0FFh  error enabling address line 20
  1875.         CF      set on error
  1876.  
  1877.  
  1878. Function 90h    Device Busy Loop                         (except PC, PCjr, XT)
  1879. entry   AH      90h
  1880.         AL      type code:
  1881.                 00h     disk
  1882.                 01h     diskette
  1883.                 02h     keyboard
  1884.                 03h     PS/2 pointing device
  1885.                 80h     network (ES:BX = ncb)
  1886.                 0FCh    disk reset
  1887.                 0FDh    diskette motor start
  1888.                 0FEh    printer
  1889.         ES:BX   pointer to request block for type codes 80h through 0BFh
  1890. return  CF      1 (set) if wait time satisfied
  1891.                 0 (clear) if driver must perform wait
  1892. note    Used by NETBIOS
  1893.         Type codes are allocated as follows:
  1894.         00h-7Fh non-reentrant devices; OS must arbitrate access
  1895.         80h-BFh reentrant devices; ES:BX points to a unique control block
  1896.         C0h-FFh wait-only calls, no complementary int 15,fn91h call
  1897.  
  1898.  
  1899. Function 91h    Set Flag and Complete Interrupt          (except PC, PCjr, XT)
  1900. entry   AH      91h
  1901.         AL      type code (see AH=90h above)
  1902.         ES:BX    pointer to request block for type codes 80h through 0BFh
  1903. return  AH       0
  1904. note    Used by NETBIOS
  1905.  
  1906.  
  1907. Function 0C0h   Get System Configuration      (XT after 1/10/86, PC Convertible,
  1908.                                                XT/286, AT, PS/2)
  1909. entry   AH      0C0h
  1910. return  CF      1 if BIOS doesn't support call
  1911.         ES:BX   pointer to ROM system descriptor table
  1912.                 dword   number of bytes following
  1913.                 byte    ID byte: PC    FF
  1914.                                  XT    FE or FB
  1915.                                  PCjr  FD
  1916.                 byte    secondary ID distingushes between AT and XT/286, etc.
  1917.                 byte    BIOS revision level, 0 for 1st release, 1 for 2nd, etc.
  1918.                 byte    feature information
  1919.                         80h     DMA channel 3 used by hard disk BIOS
  1920.                         40h     2nd 8259 installed
  1921.                         20h     realtime clock installed
  1922.                         10h     int 15h,fn 04h called upon int 09h
  1923.                         08h     wait for external event supported
  1924.                         04h     extended BIOS area allocated at 640k
  1925.                         03h     reserved
  1926.                         02h     bus is Micro Channel instead of PC
  1927.                         01h     reserved
  1928.                         00h     reserved
  1929.                 word    unknown (set to 0)
  1930.                 word    unknown (set to 0)
  1931. note    Int 15h is also used for the Multitask Hook on PS/2 machines. No
  1932.         register settings availible yet.
  1933.         The 1/10/86 XT BIOS returns an incorrect value for the feature byte.
  1934.  
  1935.  
  1936.  
  1937. Function 0C1h   System - Return Extended-BIOS Data-Area Segment Address (PS/2)
  1938. entry   AH      0C1h
  1939. return  CF      set on error
  1940.         ES      segment of data area
  1941.  
  1942.  
  1943. Function 0C2h   Pointing Device BIOS Interface      (DesQview 2.x)    (PS/2)
  1944. entry   AH      0C2h
  1945.         AL      00h     enable/disable
  1946.                         BH      00h    disable
  1947.                 01h     reset
  1948.                         return  BH     device ID
  1949.                 02h     set sampling rate
  1950.                         BH      00h    10/second
  1951.                                 01h    20/second
  1952.                                 02h    40/second
  1953.                                 03h    60/second
  1954.                                 04h    80/second
  1955.                                 05h    100/second
  1956.                                 06h    200/second
  1957.                 03h set resolution
  1958.                         BH     00h     one count per mm
  1959.                                01h     two counts per mm
  1960.                                02h     four counts per mm
  1961.                                03h     eight counts per mm
  1962.                 04h     get type
  1963.                         return  BH      device ID
  1964.                 05h     initialize
  1965.                         BH      data package size (1 - 8 bytes)
  1966.                 06h     get/set scaling factor
  1967.                         BH      00h return device status
  1968.                                 return  BL      status
  1969.                                         bit 0: right button pressed
  1970.                                         bit 1: reserved
  1971.                                         bit 2: left button pressed
  1972.                                         bit 3: reserved
  1973.                                         bit 4: 0=1:1 scaling, 1=2:1 scaling
  1974.                                         bit 5: device enabled
  1975.                                         bit 6: 0=stream mode, 1=remote mode
  1976.                                         bit 7: reserved
  1977.                                         CL      resolution (see function 03h)
  1978.                                         DL      sample rate, reports per second
  1979.                                 01h     set scaling at 1:1
  1980.                                 02h     set scaling at 2:1
  1981.                 07h     set device handler address
  1982.                         ES:BX   user device handler
  1983.                         return  AL      00h
  1984. return  CF      set on error
  1985.         AH      status
  1986.                 00h     successful
  1987.                 01h     invalid function
  1988.                 02h     invalid input
  1989.                 03h     interface error
  1990.                 04h     need to resend
  1991.                 05h     no device handler installed
  1992. note    The values in BH for those functions that take it as input are stored
  1993.         in different locations for each subfunction
  1994.  
  1995.  
  1996. Function 0C3h   Enable/Disable Watchdog Timeout                 (PS/2 50+)
  1997. entry   AH      0C3h
  1998.         AL      00h     disable
  1999.                 01h     enable
  2000.                         BX      timer counter
  2001. return  CF      set on error
  2002. note    The watchdog timer generates an NMI
  2003.  
  2004.  
  2005. Function 0C4h   Programmable Option Select                      (PS/2 50+)
  2006. entry   AH      04Ch
  2007.         AL      00h     return base POS register address
  2008.                 01h     enable slot
  2009.                         BL      slot number
  2010.                 02h     enable adapter
  2011. return  CF      set on error
  2012.         DX      base POS register address (if function 00h)
  2013.  
  2014.  
  2015. Function 0DEh   DesQview Services                             (DesQview)
  2016. entry   AH      0DEh
  2017.         AL      00h     Get Program Name
  2018.                         return  AX      offset into DESQVIEW.DVO of current
  2019.                                         program's record:
  2020.                                         byte    length of name
  2021.                                         n bytes name
  2022.                                         2 bytes keys to invoke program (second
  2023.                                                 = 00h if only one key used)
  2024.                                         word    ? (I see 0 always)
  2025.                                         byte    end flag: 00h for all but last
  2026.                                                 entry, which is 0FFh
  2027.                 01h     Update "Open Window" Menu
  2028.                         return  none
  2029.                         note    Reads DESQVIEW.DVO, disables Open menu if file
  2030.                                 not in current directory
  2031.                 02h     unimplemented in DV 2.0x
  2032.                         return  nothing (NOP in DV 2.0x)
  2033.                 03h     unimplemented in DV 2.0x
  2034.                         return  nothing (NOP in DV 2.0x)
  2035.                 04h     Get Available Common Memory
  2036.                         return  BX      bytes of common memory available
  2037.                                 CX      largest block available
  2038.                                 DX      total common memory in bytes
  2039.                 05h     Get Available Conventional Memory
  2040.                         return  BX      K of memory available
  2041.                                 CX      largest block available
  2042.                                 DX      total conventional memory in K
  2043.                 06h     Get Available Expanded Memory
  2044.                         return  BX      K of expanded memory available
  2045.                                 CX      largest block available
  2046.                                 DX      total expanded memory in K
  2047.                 07h     APPNUM  Get Current Program's Number
  2048.                         return  AX      number of program as it appears on the
  2049.                                         "Switch Windows" menu
  2050.                 08h     GET (unknown)
  2051.                         return  AX      0       unknown
  2052.                                         1       unknown
  2053.                 09h     unimplemented in DV 2.00
  2054.                         return  nothing (NOP in DV 2.00)
  2055.                 0Ah     DBGPOKE Display Character on Status Line
  2056.                         BL      character
  2057.                         return  character displayed, next call will display in
  2058.                                 next position (which wraps back to the start of
  2059.                                 the line if off the right edge of screen)
  2060.                         note 1) Displays character on bottom line of *physical*
  2061.                                 screen, regardless of current size of window
  2062.                                 (even entirely hidden)
  2063.                              2) Does not know about graphics display modes,
  2064.                                 just pokes the characters into display memory
  2065.                 0Bh     APILEVEL Define Minimum API Level Required
  2066.                         BL      API level
  2067.                                 >2 pops up "You need a newer version" error
  2068.                                 window in DV 2.00
  2069.                         BH      unknown
  2070.                         return  AX      maximum API level?
  2071.                 0Ch     GETMEM  Allocate "System" Memory
  2072.                         BX      number of bytes
  2073.                         return  ES:DI   pointer to allocated block
  2074.                 0Dh     PUTMEM  Deallocate "System" Memory
  2075.                         ES:DI   pointer to previously allocated block
  2076.                         return  nothing
  2077.                 0Eh     Find Mailbox by Name    (DV 2.0+)
  2078.                         ES:DI   pointer to name to find
  2079.                         CX      length of name
  2080.                         return  BX      0       not found
  2081.                                         1       found
  2082.                                 DS:SI   object handle
  2083.                 0Fh     Enable DesQview Extensions      (DV 2.0+)
  2084.                         return  AX and BX destroyed (seems to be bug, weren't
  2085.                                 saved & restored)
  2086.                         note 1) Sends a manager stream with opcodes AEh, BDh,
  2087.                                 and BFh to task's window
  2088.                              2) Enables an additional mouse mode
  2089.                 10h     PUSHKEY  PUT KEY INTO KEYBOARD INPUT STREAM  (DV 2.0+)
  2090.                         BH      scan code
  2091.                         BL      character
  2092.                         return  BX      unknown (sometimes, but not always,
  2093.                                         same as BX passed in)
  2094.                         note    A later read will get the keystroke as if it
  2095.                                 had been typed by the user
  2096.                 11h     ENABLE/DISABLE AUTO JUSTIFICATION OF WINDOW (DV 2.0+)
  2097.                         BL      0       viewport will not move automatically
  2098.                                 nonzero viewport will move to keep cursor
  2099.                                         visible
  2100.                         return  none
  2101.                 12h     unknown (DV 2.0+)
  2102.                         BX      0       clear something?
  2103.                                 nonzero set something?
  2104.                         return  none
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110. Interrupt 16h   Keyboard I/O
  2111. (0:0058h)       access the keyboard
  2112.  
  2113.  
  2114. Function  00h   Get Keyboard Input - read the next character in keyboard buffer,
  2115.                 if no key ready, wait for one.
  2116. entry   AH      00h
  2117. return  AH      scan code
  2118.         AL      ASCII character
  2119.  
  2120.  
  2121. Function  01h   Check Keystroke Buffer - Do Not Clear
  2122. entry   AH      01h
  2123. return  ZF      0 (clear) if character in buffer
  2124.                 1 (set)   if no character in buffer
  2125.         AH      scan code of character (if ZF=0)
  2126.         AL      ASCII character if applicable
  2127. note    Keystroke is not removed from buffer
  2128.  
  2129.  
  2130. Function  02h   Shift Status - fetch bit flags indicating shift status
  2131. entry   AH      02h
  2132. return  AL      bit codes (same as [0040:0017])
  2133.                 bit 7   Insert state
  2134.                 bit 6   CapsLock state
  2135.                 bit 5   NumLock state
  2136.                 bit 4   ScrollLock state
  2137.                 bit 3   Alt key
  2138.                 bit 2   Control key
  2139.                 bit 1   Left shift (left caps-shift key)
  2140.                 bit 0   Right shift (right caps-shift key)
  2141. note    other codes found at [0040:0018]
  2142.                 bit 7   Insert shift (Ins key)
  2143.                 bit 6   Caps shift (CapsLock key)
  2144.                 bit 5   Num shift (NumLock key)
  2145.                 bit 4   Scroll shift (ScrollLock key)
  2146.                 bit 3   Hold state (Ctrl-NumLock is in effect)
  2147.  
  2148.  
  2149. Function 03h    Keyboard - Set Repeat Rate            (PCjr, AT, XT/286, PS/2)
  2150. entry   AH      03h
  2151.         AL      00h     reset typematic             (PCjr)
  2152.                 01h     increase initial delay      (PCjr)
  2153.                 02h     increase continuing delay   (PCjr)
  2154.                 03h     increase both delays        (PCjr)
  2155.                 04h     turn off typematic          (PCjr)
  2156.                 05h     set typematic rate          (AT, PS/2)
  2157.         BH      00h-03h for delays of 250ms, 500ms, 750ms, or 1s
  2158.         BL      00h-1Fh for typematic rates of 30cps down to 2cps
  2159.  
  2160.  
  2161. Function 04h    Keyboard Click Toggle                 (PCjr and Convertible)
  2162. entry   AH      04h
  2163.         AL      00h     for click off
  2164.                 01h     for click on
  2165.  
  2166.  
  2167. Function 05h    Keyboard Buffer Write            (AT or PS/2 with enhanced kbd)
  2168.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2169. entry   AH      05h
  2170.         CH      scan code
  2171.         CL      ASCII character
  2172. return  AL      01h if buffer full
  2173.  
  2174.  
  2175. Function 10h    Get Enhanced Keystroke And Read      (F11, F12 Enhanced Keyb'd)
  2176.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2177. entry   AH      10h
  2178. return  AH      scan code
  2179.         AL      ASCII character if applicable
  2180.  
  2181.  
  2182. Function 11h    Check Enhanced Keystroke         (F11-F12 on enhanced keyboard)
  2183.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2184. entry   AH      11h
  2185. return  ZF      0       (clear) if key pressed
  2186.                 1       if buffer empty
  2187.         AH      scan code (when ZF=0)
  2188.         AL      ASCII character if applicable (when ZF=0)
  2189. note    Keystroke is not removed from buffer
  2190.  
  2191.  
  2192. Function 12h    Extended Get Shift Status         (F11, F12 Enhanced keyboard)
  2193. entry    AH     12h
  2194. return   AL     bit
  2195.                 0       right Shift key depressed
  2196.                 1       left Shift key depressed
  2197.                 2       Control key depressed
  2198.                 3       Alt key depressed
  2199.                 4       ScrollLock state active
  2200.                 5       NumLock state active
  2201.                 6       CapsLock state active
  2202.                 7       insert state is active
  2203.         AH      0       left Control key pressed
  2204.                 1       left Alt key depressed
  2205.                 2       right Control key pressed
  2206.                 3       right Alt key depressed
  2207.                 4       Scroll Lock key depressed
  2208.                 5       NumLock key depressed
  2209.                 6       CapsLock key depressed
  2210.                 7       SysReq key depressed
  2211.  
  2212.  
  2213. Function 0F0h   Set CPU speed (Compaq 386)
  2214. entry   AH      0F0h     set speed
  2215. return  unknown
  2216. note    used by Compaq DOS MODE command.
  2217.         parameters not availible
  2218.  
  2219.  
  2220.  
  2221.  
  2222. Interrupt 17h   Printer
  2223. (0:005Ch)       access the parallel printer(s)
  2224.                 AH is changed. All other registers left alone.
  2225.  
  2226. Function  00h   Print Character/send AL to printer DX (0, 1, or 2)
  2227. entry   AH      00h
  2228.         AL      character
  2229.         DX      printer to be used (0,1,2)
  2230. return  AH      status byte
  2231.                 bit
  2232.                 0       time out
  2233.                 1       unused
  2234.                 2       unused
  2235.                 3       I/O error
  2236.                 4       selected
  2237.                 5       out of paper
  2238.                 6       acknowledge
  2239.                 7       not busy
  2240.  
  2241.  
  2242. Function 01h    Initialize Printer - set init line low, send 0Ch to printer DX
  2243. entry   AH      01h
  2244.         DX      printer port to be initialized (0,1,2)
  2245. return  status as below
  2246.  
  2247.  
  2248. Function  02h   Printer Status - read status of printer DX into AH
  2249. entry   AH      02h
  2250.         DX      printer port to be used (0,1,2)
  2251. return  AH      bit flags       bit 7   0 = printer is busy
  2252.                                 bit 6   ACKnowledge line state
  2253.                                 bit 5   out-of-paper line state
  2254.                                 bit 4   printer selected line state
  2255.                                 bit 3   I/O error
  2256.                                 bit 2   unused
  2257.                                 bit 1   unused
  2258.                                 bit 0   time-out error
  2259.  
  2260.  
  2261.  
  2262.  
  2263. Interrupt 18h   ROM BASIC
  2264. (0:0060h)       Execute ROM BASIC at address 0F600h:0000h
  2265. note 1) Often reboots a compatible
  2266.  
  2267.  
  2268.  
  2269.  
  2270. Interrupt 19h   Bootstrap Loader
  2271. (0:0064h)       Reads track 0, sector 1 into address 0000h:7C00h, then transfers
  2272.                 control to that address. If no diskette drive available,
  2273.                 transfers to ROM-BASIC or displays loader error message.
  2274.                 Causes reboot of disk system if invoked while running.
  2275.                 (no memory test performed).
  2276.  
  2277.  
  2278.  
  2279.  
  2280. Interrupt 1Ah   Time of Day
  2281. (0:0068h)       access the PC internal clock
  2282.  
  2283. Function 00h    Read System Time Counter
  2284. entry   AH      00h
  2285. return  CX      high word of clock count
  2286.         DX      low word of clock count
  2287.         AL      00h if clock was read or written (via AH=0,1) within the current
  2288.                 24-hour period. Otherwise, AL > 0
  2289.  
  2290.  
  2291. Function 01h    Set Clock - set # of 55ms clock ticks in system time counter
  2292. entry   AH      01h
  2293.         CX:DX   high word/low word count of timer ticks
  2294. return  none
  2295. note 1) The clock ticks are incremented by timer interrupt at 18.2065 times
  2296.         per second or 54.9254milliseconds/count. Therefore:
  2297.                 counts per second = 18      (12h)
  2298.                 counts per minute = 1092    (444h)
  2299.                 counts per hour   = 65543   (10011h)
  2300.                 counts per day    = 1573040 (1800B0h)
  2301.      2) counter is zeroed when system is rebooted
  2302.  
  2303.      2) IBM and Microsoft recommend using int 21 Fn 4Ch. Using int 20 is
  2304.         officially frowned upon since the introduction of DOS 2.0
  2305.  
  2306.  
  2307. Function 02h    Read Real Time Clock Time                       (AT and after)
  2308. entry   AH      02h
  2309. return  CH      hours in BCD
  2310.         CL      minutes in BCD
  2311.         DH      seconds in BCD
  2312.         DL      1 (set) if daylight savings time option
  2313.         CF      1 (set) if clock not operating
  2314.  
  2315.  
  2316. Function 03h    Set Real Time Clock Time                        (AT and after)
  2317. entry   AH      03h
  2318.         CH      hours in BCD
  2319.         CL      minutes in BCD
  2320.         DH      seconds in BCD
  2321.         DL      0 (clear) if standard time
  2322.                 1 (set) if daylight savings time option
  2323. return  none
  2324.  
  2325.  
  2326. Function 04h    Read Real Time Clock Date                       (AT and after)
  2327. entry   AH      04h
  2328. return  CH      century in BCD (19 or 20)
  2329.         CL      year in BCD
  2330.         DH      month in BCD
  2331.         DL      day in BCD
  2332.         CF      1 (set) if clock not operating
  2333.  
  2334.  
  2335. Function 05h    Set Real Time Clock Date                        (AT and after)
  2336. entry   AH      05h
  2337.         CH      century in BCD (19 or 20)
  2338.         CL      year in BCD
  2339.         DH      month in BCD
  2340.         DL      day in BCD
  2341. return  none
  2342.  
  2343.  
  2344. Function 06h    Set Real Time Clock Alarm                       (AT and after)
  2345. entry   AH      06h
  2346.         CH      hours in BCD
  2347.         CL      minutes in BCD
  2348.         DH      seconds in BCD
  2349. return  CF      set if alarm already set or clock inoperable
  2350. note    Int 4Ah occurs at specified alarm time every 24hrs until reset
  2351.  
  2352.  
  2353. Function 07h    Reset Real Time Clock Alarm                     (AT and after)
  2354. entry   AH      07h
  2355. return  none
  2356.  
  2357.  
  2358. Function 08h    Set Real Time Clock Activated Power On Mode     (Convertible)
  2359. entry   AH      08h
  2360.         CH      hours in BCD
  2361.         CL      minutes in BCD
  2362.         DH      seconds in BCD
  2363.  
  2364.  
  2365. Function 09h    Read Real Time Clock Alarm Time and Status
  2366.                                                 (Convertible and PS/2 Model 30)
  2367. entry   AH      09h
  2368. return  CH      hours in BCD
  2369.         CL      minutes in BCD
  2370.         DH      seconds in BCD
  2371.         DL      alarm status:
  2372.                 00h     if alarm not enabled
  2373.                 01h     if alarm enabled but will not power up system
  2374.                 02h     if alarm will power up system
  2375.  
  2376.  
  2377. Function 0Ah    Read System-Timer Day Counter   (XT-2 [640k motherboard], PS/2)
  2378. entry   AH      0Ah
  2379. return  CF      set on error
  2380.         CX      count of days since Jan 1,1980
  2381.  
  2382. Function 0Bh    Set System-Timer Day Counter    (XT-2 [640k motherboard], PS/2)
  2383. entry   AH      0Bh
  2384.         CX      count of days since Jan 1,1980
  2385. return  CF      set on error
  2386.  
  2387.  
  2388. Function 80h    Set Up Sound Multiplexor                (PCjr) (Tandy 1000?)
  2389. entry   AH      80h
  2390.         AL      00h     source is 8253 channel 2
  2391.                 01h     source is cassette input
  2392.                 02h     source is I/O channel "audio in"
  2393.                 03h     source is TI sound generator chip
  2394.  
  2395.  
  2396.  
  2397.  
  2398. Interrupt 1Bh   Control-Break
  2399. (0:006Ch)       This interrupt is called when the keyboard scanner of the IBM
  2400.                 machines detects Ctrl and Break pressed at the same time.
  2401.  
  2402. note 1) If the break occurred while processing an interrupt, one or more
  2403.         end of interrupt commands must be send to the 8259 Programmable
  2404.         Interrupt Controller.
  2405.      2) All I/O devices should be reset in case an operation was underway at
  2406.         the time.
  2407.      3) It is normally pointed to an IRET during system initialization so that
  2408.         it does nothing, but some programs change it to return a ctrl-C scan
  2409.         code and thus invoke int 23h.
  2410.  
  2411.  
  2412.  
  2413.  
  2414. Interrupt 1Ch   Timer Tick
  2415. (0:0070h)
  2416. note 1) Taken 18.2065 times per second
  2417.      2) Normally vectors to dummy IRET unless PRINT.COM has been installed.
  2418.      3) If an application moves the interrupt pointer, it is the responsibility
  2419.         of that application to save and restore all registers that may be
  2420.         modified.
  2421.  
  2422.  
  2423.  
  2424.  
  2425. Interrupt 1Dh   Vector of Video Initialization Parameters.
  2426. (0:0074h)       This doubleword address points to 3 sets of 16-bytes containing
  2427.                 data to initialize for video modes for video modes 0 & 1 (40
  2428.                 column), 2 & 3 (80 column), and 4, 5 & 6 (graphics) on the
  2429.                 Motorola 6845 CRT controller chip.
  2430.  6845 registers:
  2431.         R0      horizontal total (horizontal sync in characters)
  2432.         R1      horizontal displayed (characters per line)
  2433.         R2      horizontal sync position (move display left or right)
  2434.         R3      sync width (vertical and horizontal pulse: 4-bits each)
  2435.         R4      vertical total (total character lines)
  2436.         R5      vertical adjust (adjust for 50 or 60 Hz refresh)
  2437.         R6      vertical displayed (lines of chars displayed)
  2438.         R7      vertical sync position (lines shifted up or down)
  2439.         R8      interlace (bits 4 and 5) and skew (bits 6 and 7)
  2440.         R9      max scan line addr (scan lines per character row)
  2441.         R10     cursor start (starting scan line of cursor)
  2442.         R11     cursor stop (ending scan line of cursor)
  2443.         R12     video memory start address high byte (6-bits)
  2444.         R13     video memory start address low byte (8-bits)
  2445.         R14     cursor address high byte (6-bits)
  2446.         R15     cursor address low byte (8-bits)
  2447.  
  2448.  6845 Video Init Tables:
  2449.         table for modes 0 and 1   \
  2450.         table for modes 2 and 3    \ each table is 16 bytes long and
  2451.         table for modes 4,5, and 6 / contains values for 6845 registers
  2452.         table for mode 7          /
  2453.         4 words:   size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  2454.         8 bytes:   number of columns in each mode
  2455.         8 bytes:   video controller mode byte for each mode
  2456. note 1) There are 4 separate tables, and all 4 must be initialized if all
  2457.         video modes will be used.
  2458.      2) The power-on initialization code of the computer points this vector
  2459.         to the ROM BIOS video routines.
  2460.      3) IBM recommends that is this table needs to be modified, it should be
  2461.         copied into RAM and only the nescessary changes made.
  2462.  
  2463.  
  2464.  
  2465.  
  2466. Interrupt 1Eh   Vector of Diskette Controller Parameters
  2467. (0:0078h)       Dword address points to data base table that is used by BIOS.
  2468.                 Default location is at 0F000:0EFC7h. 11-byte table format:
  2469.                 bytes:
  2470.                 00h     4-bit step rate, 4-bit head unload time
  2471.                 01h     7-bit head load time, 1-bit DMA flag
  2472.                 02h     54.9254 ms counts - delay till motor off (37-38 typ)
  2473.                 03h     sector size:
  2474.                         00h     128 bytes
  2475.                         01h     256 bytes
  2476.                         02h     512 bytes
  2477.                         03h     1024 bytes
  2478.                 04h     last sector on track (8 or 9 typical)
  2479.                 05h     gap between sectors on read/write (42 typical)
  2480.                 06h     data length for DMA transfers (0FFh typical)
  2481.                 07h     gap length between sectors for format (80 typical)
  2482.                 08h     sector fill byte for format (0F6h typical)
  2483.                 09h     head settle time (in milliseconds) (15 to 25 typical)
  2484.                         DOS 1.0   0
  2485.                         DOS 2.10  15
  2486.                         DOS 3.1   1
  2487.                 10h     motor start time (in 1/8 second intervals) (2 to 4 typ.)
  2488.                         DOS 2.10  2
  2489. note 1) This vector is pointed to the ROM BIOS diskette tables on system
  2490.         initialization
  2491.      2) IBM recommends that is this table needs to be modified, it should be
  2492.         copied into RAM and only the nescessary changes made.
  2493.  
  2494.  
  2495.  
  2496.  
  2497. Interrupt 1Fh   Pointer to Graphics Character Extensions (Graphics Set 2)
  2498. (0:007Ch)       This is the pointer to data used by the ROM video routines to
  2499.                 display characters above ASCII 127 while in CGA medium and high
  2500.                 res graphics modes.
  2501.  
  2502. note 1) Doubleword address points to 1K table composed of 28 8-byte character
  2503.         definition bit-patterns. First byte of each entry is top row, last byte
  2504.         is bottom row.
  2505.      2) The first 128 character patterns are located in system ROM.
  2506.      3) This vector is set to 000:0 at system initialization
  2507.      4) Used by DOS' external GRAFTABL command
  2508.  
  2509.  
  2510. Interrupt 20h   PROGRAM TERMINATE
  2511. (0:0080h)
  2512.  Issue int 20h to exit from a program. This vector transfers to the logic in
  2513. DOS to restore the terminate address, the Ctrl-Break address,and the critical
  2514. error exit address to the values they had on entry to the program. All the file
  2515. buffers are flushed and all handles are closed. You should close all files
  2516. changed in length (see function calls 10h and 3Eh) before issuing this
  2517. interrupt. If the changed file is not closed, its length, time, and date are
  2518. not recorded correctly in the directory.
  2519.  For a program to pass a completion code or an error code when terminating, it
  2520. must use either function call 4Ch (Terminate a Process) or 31h (Terminate
  2521. Process and Stay Resident). These two methods are preferred over using
  2522. int 20h and the codes returned by them can be interrogated in batch processing.
  2523. Important: Before you issue an interrupt 20h, your program must ensure that
  2524.            the CS register contains the segment of its program segment prefix.
  2525.  
  2526. Interrupt 20h   DOS - Terminate Program
  2527. entry   no parameters
  2528. return  none
  2529.  
  2530. Interrupt 20h   Minix - Send/Receive Message
  2531. entry   AX      process ID of other process
  2532.         BX      pointer to message
  2533.         CX      1       send
  2534.                 2       receive
  2535.                 3       send&receive
  2536. note    The message contains the system call number (numbered as in V7 Unix)
  2537.         and the call parameters
  2538.  
  2539.  
  2540.